Skip to content

Commit

Permalink
wifi: mt76: mt7615: fix possible race in mt7615_mac_sta_poll
Browse files Browse the repository at this point in the history
[ Upstream commit 30bc32c ]

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: a621372 ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
LorenzoBianconi authored and gregkh committed Jun 14, 2023
1 parent 84c6996 commit e783f63
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/wireless/mediatek/mt76/mt7615/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,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;

Expand Down

0 comments on commit e783f63

Please sign in to comment.