]> Git Repo - linux.git/commitdiff
LoongArch: Fix debugfs_create_dir() error checking
authorImmad Mir <[email protected]>
Thu, 15 Jun 2023 06:35:56 +0000 (14:35 +0800)
committerHuacai Chen <[email protected]>
Thu, 15 Jun 2023 06:35:56 +0000 (14:35 +0800)
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]>
arch/loongarch/kernel/unaligned.c

index bdff825d29ef4dd252430cbd0f5e923fb102cb5f..85fae3d2d71aebc5691686cfe67214561fd8d6fe 100644 (file)
@@ -485,7 +485,7 @@ static int __init debugfs_unaligned(void)
        struct dentry *d;
 
        d = debugfs_create_dir("loongarch", NULL);
-       if (!d)
+       if (IS_ERR_OR_NULL(d))
                return -ENOMEM;
 
        debugfs_create_u32("unaligned_instructions_user",
This page took 0.050714 seconds and 4 git commands to generate.