[PATCH v1] lib:Fix an NULL vs IS_ERR() bug for debugfs_create_dir() in err_inject_init()

From: Wang Ming
Date: Wed Jul 12 2023 - 09:53:07 EST


The debugfs_create_dir() function returns error pointers.
It never returns NULL. Most incorrect error checks were fixed,
but the one in err_inject_init() was forgotten.

Fix the remaining error check.

Signed-off-by: Wang Ming <machel@xxxxxxxx>
---
lib/notifier-error-inject.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/notifier-error-inject.c b/lib/notifier-error-inject.c
index 2b24ea6c9497..c49354c23802 100644
--- a/lib/notifier-error-inject.c
+++ b/lib/notifier-error-inject.c
@@ -83,7 +83,7 @@ static int __init err_inject_init(void)
notifier_err_inject_dir =
debugfs_create_dir("notifier-error-inject", NULL);

- if (!notifier_err_inject_dir)
+ if (IS_ERR(notifier_err_inject_dir))
return -ENOMEM;

return 0;
--
2.25.1