From 2a1d18a5dc5056825b8e9527d188130da6256efc Mon Sep 17 00:00:00 2001 From: Osama Muhammad Date: Tue, 16 May 2023 23:29:27 +0500 Subject: ras/debugfs: Fix error checking for debugfs_create_dir() Check the return value of debugfs_create_dir() properly. [ bp: Rewrite commit message. ] Signed-off-by: Osama Muhammad Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230516182927.9171-1-osmtendev@gmail.com --- drivers/ras/debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/ras') diff --git a/drivers/ras/debugfs.c b/drivers/ras/debugfs.c index f0a6391b1146..ffb973c328e3 100644 --- a/drivers/ras/debugfs.c +++ b/drivers/ras/debugfs.c @@ -46,7 +46,7 @@ int __init ras_add_daemon_trace(void) fentry = debugfs_create_file("daemon_active", S_IRUSR, ras_debugfs_dir, NULL, &trace_fops); - if (!fentry) + if (IS_ERR(fentry)) return -ENODEV; return 0; -- cgit v1.2.3-70-g09d2