mt7915_mac_full_reset() runs INIT_LIST_HEAD() on dev->sta_rc_list while stations can still be on it. A removal of such a station before the replay then corrupts the list. Take the remaining stations off the list under sta_poll_lock, as mt76_reset_device() does for sta_poll_list. Fixes: 065c79df595a ("wifi: mt76: mt7915: fix list corruption after hardware restart") Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c index 24207880211e..cfa7433dc470 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c @@ -1471,7 +1471,11 @@ mt7915_mac_full_reset(struct mt7915_dev *dev) mt76_reset_device(&dev->mt76); - 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); i = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA); -- 2.47.3