wifi: iwlwifi: mvm: unlock mvm if there is no primary link
authorBenjamin Berg <benjamin.berg@intel.com>
Sun, 18 Feb 2024 17:51:46 +0000 (19:51 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 21 Feb 2024 14:19:04 +0000 (15:19 +0100)
At that point in the code mvm->mutex has already been taken, so jump to
out_noreset in order to unlock before returning the error.

Fixes: 8c9bef26e98b ("wifi: iwlwifi: mvm: d3: implement suspend with MLO")
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240218194912.21de6e68d9e5.I3c0ebe577dec6b26ab6b4eac48035d6f35a8b0f8@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/d3.c

index 9830a3c3600b94d25e39b56697c078a6a69c4d60..6d5ed79b9fff0b21fede24a3728e580385cefbfd 100644 (file)
@@ -1290,8 +1290,10 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
        mvmvif = iwl_mvm_vif_from_mac80211(vif);
 
        mvm_link = mvmvif->link[primary_link];
-       if (WARN_ON_ONCE(!mvm_link))
-               return -EINVAL;
+       if (WARN_ON_ONCE(!mvm_link)) {
+               ret = -EINVAL;
+               goto out_noreset;
+       }
 
        if (mvm_link->ap_sta_id == IWL_MVM_INVALID_STA) {
                /* if we're not associated, this must be netdetect */