aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorImmad Mir <mirimmad17@gmail.com>2023-06-15 14:35:56 +0800
committerHuacai Chen <chenhuacai@loongson.cn>2023-06-15 14:35:56 +0800
commit41efbb682de1231c3f6361039f46ad149e3ff5b9 (patch)
tree997516ece26473f01e1cdcd2840ab32e4a3d650e
parent0246d0aaf0a634a65135050011767b56ba351a8f (diff)
downloadperf-tools-next-41efbb682de1231c3f6361039f46ad149e3ff5b9.tar.gz
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>
-rw-r--r--arch/loongarch/kernel/unaligned.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/loongarch/kernel/unaligned.c b/arch/loongarch/kernel/unaligned.c
index bdff825d29ef4d..85fae3d2d71aeb 100644
--- a/arch/loongarch/kernel/unaligned.c
+++ b/arch/loongarch/kernel/unaligned.c
@@ -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",