[PATCH v1] lib: fix two parameters check in ei_debugfs_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make IS_ERR() judge the debugfs_create_dir() function return
in ei_debugfs_init().

Signed-off-by: Minjie Du <duminjie@xxxxxxxx>
---
 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





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux