summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek/mt76/mt7615
diff options
context:
space:
mode:
authorLorenzo Bianconi <lorenzo@kernel.org>2023-05-24 17:39:32 +0300
committerKalle Valo <kvalo@kernel.org>2023-05-27 11:17:17 +0300
commit30bc32c7c1f975cc3c14e1c7dc437266311282cf (patch)
tree9aa6ec20b9a253d1e0ea6e5cb141a98cc7f0bd8e /drivers/net/wireless/mediatek/mt76/mt7615
parent212457ccbd60dba34f965e4ffbe62f0e4f970538 (diff)
downloadlinux-30bc32c7c1f975cc3c14e1c7dc437266311282cf.tar.xz
wifi: mt76: mt7615: fix possible race in mt7615_mac_sta_poll
Grab sta_poll_lock spinlock in mt7615_mac_sta_poll routine in order to avoid possible races with mt7615_mac_add_txs() or mt7615_mac_fill_rx() removing msta pointer from sta_poll_list. Fixes: a621372a04ac ("mt76: mt7615: rework mt7615_mac_sta_poll for usb code") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/48b23404b759de4f1db2ef85975c72a4aeb1097c.1684938695.git.lorenzo@kernel.org
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7615')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7615/mac.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
index da1d17b73a25..64002484ccad 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
@@ -914,7 +914,10 @@ void mt7615_mac_sta_poll(struct mt7615_dev *dev)
msta = list_first_entry(&sta_poll_list, struct mt7615_sta,
poll_list);
+
+ spin_lock_bh(&dev->sta_poll_lock);
list_del_init(&msta->poll_list);
+ spin_unlock_bh(&dev->sta_poll_lock);
addr = mt7615_mac_wtbl_addr(dev, msta->wcid.idx) + 19 * 4;