mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: mt7996: grab mt76 mutex in mt7996_mac_sta_event()
Grab mt76 mutex in mt7996_mac_sta_event routine in order to rely on
mt76_dereference() utility macro.
Fixes: ecd72f9695e7e ("wifi: mt76: mt7996: Support MLO in mt7996_mac_sta_event()")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Tested-by: Ben Greear <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
f473d66ab5
commit
7d17569dae
+10
-5
@@ -1158,12 +1158,15 @@ mt7996_mac_sta_event(struct mt7996_dev *dev, struct ieee80211_vif *vif,
|
||||
unsigned long links = sta->valid_links;
|
||||
struct ieee80211_link_sta *link_sta;
|
||||
unsigned int link_id;
|
||||
int err = 0;
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
|
||||
for_each_sta_active_link(vif, sta, link_sta, link_id) {
|
||||
struct ieee80211_bss_conf *link_conf;
|
||||
struct mt7996_sta_link *msta_link;
|
||||
struct mt7996_vif_link *link;
|
||||
int i, err;
|
||||
int i;
|
||||
|
||||
link_conf = link_conf_dereference_protected(vif, link_id);
|
||||
if (!link_conf)
|
||||
@@ -1183,12 +1186,12 @@ mt7996_mac_sta_event(struct mt7996_dev *dev, struct ieee80211_vif *vif,
|
||||
link, msta_link,
|
||||
CONN_STATE_CONNECT, true);
|
||||
if (err)
|
||||
return err;
|
||||
goto unlock;
|
||||
|
||||
err = mt7996_mcu_add_rate_ctrl(dev, msta_link->sta, vif,
|
||||
link_id, false);
|
||||
if (err)
|
||||
return err;
|
||||
goto unlock;
|
||||
|
||||
msta_link->wcid.tx_info |= MT_WCID_TX_INFO_SET;
|
||||
break;
|
||||
@@ -1197,7 +1200,7 @@ mt7996_mac_sta_event(struct mt7996_dev *dev, struct ieee80211_vif *vif,
|
||||
link, msta_link,
|
||||
CONN_STATE_PORT_SECURE, false);
|
||||
if (err)
|
||||
return err;
|
||||
goto unlock;
|
||||
break;
|
||||
case MT76_STA_EVENT_DISASSOC:
|
||||
for (i = 0; i < ARRAY_SIZE(msta_link->twt.flow); i++)
|
||||
@@ -1217,8 +1220,10 @@ mt7996_mac_sta_event(struct mt7996_dev *dev, struct ieee80211_vif *vif,
|
||||
break;
|
||||
}
|
||||
}
|
||||
unlock:
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
|
||||
return 0;
|
||||
return err;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user