diff mbox series

[17/34] wifi: iwlwifi: mvm: skip inactive links

Message ID 20230329100039.bd9b4e64c478.Ie21422c3bf2589d22942c3c57d26e6330d2e3afc@changeid (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show
Series wifi: iwlwifi: updates intended for v6.4 2023-03-29 | expand

Commit Message

Greenman, Gregory March 29, 2023, 7:05 a.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

When iterating station links, skip the links that are not
yet active by checking for mvmvif->link[] existence.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 568f0eaeb0fb..1fd7e5bf594d 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -3657,7 +3657,7 @@  static void iwl_mvm_vif_set_he_support(struct ieee80211_hw *hw,
 		struct ieee80211_bss_conf *link_conf =
 			rcu_dereference_protected(vif->link_conf[i], 1);
 
-		if (!link_conf || !link_sta)
+		if (!link_conf || !link_sta || !mvmvif->link[i])
 			continue;
 
 		link_conf->he_support = link_sta->he_cap.has_he;
@@ -3757,6 +3757,8 @@  iwl_mvm_sta_state_auth_to_assoc(struct ieee80211_hw *hw,
 
 			if (WARN_ON(!link_conf))
 				return -EINVAL;
+			if (!mvmvif->link[i])
+				continue;
 
 			iwl_mvm_link_changed(mvm, vif, link_conf,
 					     LINK_CONTEXT_MODIFY_ALL &