Skip to content

Commit 38676d9

Browse files
Yang Ruibinakpm00
authored andcommitted
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/[email protected] Signed-off-by: Yang Ruibin <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent fb54ea1 commit 38676d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/test_fpu_glue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static int __init test_fpu_init(void)
4242
return -EINVAL;
4343

4444
selftest_dir = debugfs_create_dir("selftest_helpers", NULL);
45-
if (!selftest_dir)
45+
if (IS_ERR(selftest_dir))
4646
return -ENOMEM;
4747

4848
debugfs_create_file_unsafe("test_fpu", 0444, selftest_dir, NULL,

0 commit comments

Comments
 (0)