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>
This commit is contained in:
parent
fb54ea1ee8
commit
38676d9e33
@ -42,7 +42,7 @@ static int __init test_fpu_init(void)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
selftest_dir = debugfs_create_dir("selftest_helpers", NULL);
|
selftest_dir = debugfs_create_dir("selftest_helpers", NULL);
|
||||||
if (!selftest_dir)
|
if (IS_ERR(selftest_dir))
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
debugfs_create_file_unsafe("test_fpu", 0444, selftest_dir, NULL,
|
debugfs_create_file_unsafe("test_fpu", 0444, selftest_dir, NULL,
|
||||||
|
Loading…
Reference in New Issue
Block a user