summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorYang Ruibin <11162571@vivo.com>2024-08-21 03:34:40 -0400
committerAndrew Morton <akpm@linux-foundation.org>2024-09-01 20:43:40 -0700
commit38676d9e33133c0c39951b812b19cc5b9ff1978a (patch)
tree02aba9b412c63825fe3eb3f282448d44b44e5eee /lib
parentfb54ea1ee84534cab6a15515c73a0811bdcbc973 (diff)
downloadlinux-38676d9e33133c0c39951b812b19cc5b9ff1978a.tar.gz
linux-38676d9e33133c0c39951b812b19cc5b9ff1978a.tar.bz2
linux-38676d9e33133c0c39951b812b19cc5b9ff1978a.zip
lib: fix the NULL vs IS_ERR() bug for debugfs_create_dir()
debugfs_create_dir() returns error pointers. It never returns NULL. So use IS_ERR() to check it. Link: https://lkml.kernel.org/r/20240821073441.9701-1-11162571@vivo.com Signed-off-by: Yang Ruibin <11162571@vivo.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/test_fpu_glue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/test_fpu_glue.c b/lib/test_fpu_glue.c
index 074f30301f29..c0596426370a 100644
--- a/lib/test_fpu_glue.c
+++ b/lib/test_fpu_glue.c
@@ -42,7 +42,7 @@ static int __init test_fpu_init(void)
return -EINVAL;
selftest_dir = debugfs_create_dir("selftest_helpers", NULL);
- if (!selftest_dir)
+ if (IS_ERR(selftest_dir))
return -ENOMEM;
debugfs_create_file_unsafe("test_fpu", 0444, selftest_dir, NULL,