Skip to content

Commit 41efbb6

Browse files
mirimmadchenhuacai
authored andcommitted
LoongArch: Fix debugfs_create_dir() error checking
The debugfs_create_dir() returns ERR_PTR in case of an error and the correct way of checking it is using the IS_ERR_OR_NULL inline function rather than the simple null comparision. This patch fixes the issue. Cc: [email protected] Suggested-By: Ivan Orlov <[email protected]> Signed-off-by: Immad Mir <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent 0246d0a commit 41efbb6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/loongarch/kernel/unaligned.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ static int __init debugfs_unaligned(void)
485485
struct dentry *d;
486486

487487
d = debugfs_create_dir("loongarch", NULL);
488-
if (!d)
488+
if (IS_ERR_OR_NULL(d))
489489
return -ENOMEM;
490490

491491
debugfs_create_u32("unaligned_instructions_user",

0 commit comments

Comments
 (0)