Skip to contentSkip to conversation

iwlwifi: mvm: Fix an error code in iwl_mvm_up()

PATCH New Dan Carpenter 1 participant 1 message Aug 16, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iwlwifi: mvm: Fix an error code in iwl_mvm_up()

Return -ENODEV instead of success on this error path.

Fixes dd36a507c806 ("iwlwifi: mvm: look for the first supported channel when add/remove phy ctxt")

---
From static analysis. Not tested.

 drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +3 -1
index 38fd5886af2d..1962abb81faa 100644
@@ -1461,8 +1461,10 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
 	while (!sband && i < NUM_NL80211_BANDS)
 		sband = mvm->hw->wiphy->bands[i++];
 
-	if (WARN_ON_ONCE(!sband))
+	if (WARN_ON_ONCE(!sband)) {
+		ret = -ENODEV;
 		goto error;
+	}
 
 	chan = &sband->channels[0];
 
Signature · 1 line
2.20.1