[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240821073441.9701-1-11162571@vivo.com>
Date: Wed, 21 Aug 2024 03:34:40 -0400
From: Yang Ruibin <11162571@...o.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Cc: opensource.kernel@...o.com,
Yang Ruibin <11162571@...o.com>
Subject: [PATCH v1] lib:Fix the NULL vs IS_ERR() bug for debugfs_create_dir()
The debugfs_create_dir() function returns error pointers.
It never returns NULL. So use IS_ERR() to check it.
Signed-off-by: Yang Ruibin <11162571@...o.com>
---
lib/test_fpu_glue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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,
--
2.34.1
Powered by blists - more mailing lists