diff mbox series

[1/1] iwlwifi: mei: fix return value check in iwl_mei_dbgfs_register()

Message ID 20241023065220.258-1-thunder.leizhen@huawei.com
State New
Headers show
Series [1/1] iwlwifi: mei: fix return value check in iwl_mei_dbgfs_register() | expand

Commit Message

Leizhen (ThunderTown) Oct. 23, 2024, 6:52 a.m. UTC
Fix the incorrect return value check for debugfs_create_dir(), which
returns ERR_PTR(-ERROR) instead of NULL when it fails.

Fixes: 4ea7da5fad43 ("iwlwifi: mei: add debugfs hooks")
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 drivers/net/wireless/intel/iwlwifi/mei/main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/mei/main.c b/drivers/net/wireless/intel/iwlwifi/mei/main.c
index dce0b7cf7b265c6..17a08ecd11b3202 100644
--- a/drivers/net/wireless/intel/iwlwifi/mei/main.c
+++ b/drivers/net/wireless/intel/iwlwifi/mei/main.c
@@ -1921,8 +1921,7 @@  static const struct file_operations iwl_mei_dbgfs_req_ownership_ops = {
 static void iwl_mei_dbgfs_register(struct iwl_mei *mei)
 {
 	mei->dbgfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL);
-
-	if (!mei->dbgfs_dir)
+	if (IS_ERR(mei->dbgfs_dir))
 		return;
 
 	debugfs_create_ulong("status", S_IRUSR,