[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230712135226.10041-1-machel@vivo.com>
Date: Wed, 12 Jul 2023 21:52:11 +0800
From: Wang Ming <machel@...o.com>
To: David Hildenbrand <david@...hat.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Akinobu Mita <akinobu.mita@...il.com>,
Wang Ming <machel@...o.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Cc: opensource.kernel@...o.com
Subject: [PATCH v1] lib:Fix an NULL vs IS_ERR() bug for debugfs_create_dir() in err_inject_init()
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@...o.com>
---
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
Powered by blists - more mailing lists