iwlwifi: mvm: Fix an error code in iwl_mvm_up()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 16 Aug 2021 18:39:30 +0000 (21:39 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 18 Feb 2022 08:40:56 +0000 (10:40 +0200)
Return -ENODEV instead of success on this error path.

Fixes: dd36a507c806 ("iwlwifi: mvm: look for the first supported channel when add/remove phy ctxt")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20210816183930.GA2068@kili
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/fw.c

index 9aa15f0..8537e1e 100644 (file)
@@ -1709,8 +1709,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];