mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 14:04:54 +02: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: ecd72f9695 ("wifi: mt76: mt7996: Support MLO in mt7996_mac_sta_event()")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Tested-by: Ben Greear <greearb@candelatech.com>
Link: https://patch.msgid.link/20251114-mt76-fix-missing-mtx-v1-1-259ebf11f654@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
2ccbea08dd
commit
5a4bcba26e
|
|
@ -1159,12 +1159,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)
|
||||
|
|
@ -1184,12 +1187,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;
|
||||
|
|
@ -1198,7 +1201,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++)
|
||||
|
|
@ -1218,8 +1221,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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user