lib: fix two parameters check in ei_debugfs_init()
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- lib/error-inject.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/error-inject.c +2 -2
@@ -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 ; }
Signature · 1 line
2.39.0
Quoted 2 lines
Make
IS_ERR()judge thedebugfs_create_dir()function return inei_debugfs_init().
Would a subject like “[PATCH v2] lib/error-inject: Fix checks for two variables in ei_debugfs_init()” be more appropriate?
Regards,
Markus