diff mbox series

[v1] drivers: fix parameter check in create_debugfs_nodes()

Message ID 20230712120658.14032-1-duminjie@vivo.com (mailing list archive)
State New, archived
Headers show
Series [v1] drivers: fix parameter check in create_debugfs_nodes() | expand

Commit Message

Minjie Du July 12, 2023, 12:06 p.m. UTC
Make IS_ERR() judge the debugfs_create_dir() function return
in create_debugfs_nodes()

Signed-off-by: Minjie Du <duminjie@vivo.com>
---
 drivers/ras/cec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/ras/cec.c b/drivers/ras/cec.c
index 321af498e..27db1ae9f 100644
--- a/drivers/ras/cec.c
+++ b/drivers/ras/cec.c
@@ -483,7 +483,7 @@  static int __init create_debugfs_nodes(void)
 	struct dentry *d, *pfn, *decay, *count, *array;
 
 	d = debugfs_create_dir("cec", ras_debugfs_dir);
-	if (!d) {
+	if (IS_ERR(d)) {
 		pr_warn("Error creating cec debugfs node!\n");
 		return -1;
 	}