[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20230712131630.16552-1-duminjie@vivo.com>
Date: Wed, 12 Jul 2023 21:16:30 +0800
From: Minjie Du <duminjie@...o.com>
To: Stephen Rothwell <sfr@...b.auug.org.au>,
Minjie Du <duminjie@...o.com>,
linux-kernel@...r.kernel.org (open list),
bpf@...r.kernel.org (open list:BPF [MISC])
Cc: opensource.kernel@...o.com
Subject: [PATCH v1] lib: fix two parameters check in ei_debugfs_init()
Make IS_ERR() judge the debugfs_create_dir() function return
in ei_debugfs_init().
Signed-off-by: Minjie Du <duminjie@...o.com>
---
lib/error-inject.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/error-inject.c b/lib/error-inject.c
index 32c147705..9dd2c5ca3 100644
--- a/lib/error-inject.c
+++ b/lib/error-inject.c
@@ -217,11 +217,11 @@ static int __init ei_debugfs_init(void)
struct dentry *dir, *file;
dir = debugfs_create_dir("error_injection", NULL);
- if (!dir)
+ if (IS_ERR(dir))
return -ENOMEM;
file = debugfs_create_file("list", 0444, dir, NULL, &ei_fops);
- if (!file) {
+ if (IS_ERR(file)) {
debugfs_remove(dir);
return -ENOMEM;
}
--
2.39.0
Powered by blists - more mailing lists