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: stable@vger.kernel.org Suggested-By: Ivan Orlov <ivan.orlov0322@gmail.com> Signed-off-by: Immad Mir <mirimmad17@gmail.com> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent 0246d0a commit 41efbb6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)