Skip to content

Commit

Permalink
lib: fix the NULL vs IS_ERR() bug for debugfs_create_dir()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Yang Ruibin authored and akpm00 committed Sep 2, 2024
1 parent fb54ea1 commit 38676d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/test_fpu_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 38676d9

Please sign in to comment.