mt7996_mac_full_reset() runs INIT_LIST_HEAD() on dev->sta_rc_list while links can still be on it. mt7996_mac_reset_sta_iter() takes the links of a station off the list, but it does not see a station that mac80211 took off its station list before the reset. The later mt7996_mac_sta_remove() of such a station then corrupts the list. Take the remaining links off the list under sta_poll_lock, as mt76_reset_device() does for sta_poll_list. Fixes: ace5d3b6b49e ("wifi: mt76: mt7996: improve hardware restart reliability") Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7996/mac.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c index 8a8098f4fc82..eb0f2dd7bb7f 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c @@ -2532,7 +2532,11 @@ mt7996_mac_full_reset(struct mt7996_dev *dev) IEEE80211_IFACE_SKIP_SDATA_NOT_IN_DRIVER, mt7996_mac_reset_vif_iter, dev); - INIT_LIST_HEAD(&dev->sta_rc_list); + spin_lock_bh(&dev->mt76.sta_poll_lock); + while (!list_empty(&dev->sta_rc_list)) + list_del_init(dev->sta_rc_list.next); + spin_unlock_bh(&dev->mt76.sta_poll_lock); + INIT_LIST_HEAD(&dev->twt_list); spin_lock_bh(&dev->wed_rro.lock); -- 2.47.3