Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Yang Ruibin and committed by
Andrew Morton
38676d9e fb54ea1e

+1 -1
+1 -1
lib/test_fpu_glue.c
··· 42 42 return -EINVAL; 43 43 44 44 selftest_dir = debugfs_create_dir("selftest_helpers", NULL); 45 - if (!selftest_dir) 45 + if (IS_ERR(selftest_dir)) 46 46 return -ENOMEM; 47 47 48 48 debugfs_create_file_unsafe("test_fpu", 0444, selftest_dir, NULL,