From 325eb4b4197e65bfc9fac73627705ce16ee4715d Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 22 Aug 2024 19:31:31 +0200 Subject: [PATCH] wifi: mt76: mt7915: fix sta poll list corruption on hw restart When ieee80211_restart_hw is called, all interfaces and stations are recreated. This can lead to corruption in the sta poll list, since existing entries were not removed before their private data is reset. Signed-off-by: Felix Fietkau --- mt7915/mac.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mt7915/mac.c b/mt7915/mac.c index fc03cb49..e9ed94bf 100644 --- a/mt7915/mac.c +++ b/mt7915/mac.c @@ -1468,6 +1468,11 @@ mt7915_mac_full_reset(struct mt7915_dev *dev) if (i == 10) dev_err(dev->mt76.dev, "chip full reset failed\n"); + spin_lock_bh(&dev->mt76.sta_poll_lock); + while (!list_empty(&dev->mt76.sta_poll_list)) + list_del_init(dev->mt76.sta_poll_list.next); + spin_unlock_bh(&dev->mt76.sta_poll_lock); + ieee80211_restart_hw(mt76_hw(dev)); if (ext_phy) ieee80211_restart_hw(ext_phy->hw);