Skip to contentSkip to conversation

iwlwifi: mei: fix return value check in iwl_mei_dbgfs_register()

PATCH New Zhen Lei 1 participant 1 message Oct 23, 2024 Intel wireless wifi link (iwlwifi)

lore
Share & tools
lore

Zhen Lei

author
#0 lore raw

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

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")
---
 drivers/net/wireless/intel/iwlwifi/mei/main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/mei/main.c +1 -2
index dce0b7cf7b265c6..17a08ecd11b3202 100644
@@ -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,
Signature · 1 line
2.34.1