Skip to content

Commit 7e4208e

Browse files
committed
wifi: mt76: mt7996: free vif links after clearing wcid entries on full reset
mt7996_mac_reset_vif_iter() queues non-default vif links for kfree_rcu while dev->wcid[] still holds pointers to the wcid embedded in each freed link; mt76_reset_device() then dereferences those entries and runs mt76_wcid_cleanup() on them. If a grace period elapses in between, the cleanup operates on freed memory. Run mt76_reset_device() first, so the wcid entries are cleaned up and cleared while the links are still valid. Fixes: ace5d3b ("wifi: mt76: mt7996: improve hardware restart reliability") Link: https://patch.msgid.link/20260724124813.3961474-25-nbd@nbd.name Signed-off-by: Felix Fietkau <nbd@nbd.name>
1 parent 496ea8c commit 7e4208e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • drivers/net/wireless/mediatek/mt76/mt7996

drivers/net/wireless/mediatek/mt76/mt7996/mac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2485,10 +2485,10 @@ mt7996_mac_full_reset(struct mt7996_dev *dev)
24852485
phy->omac_mask = 0;
24862486

24872487
ieee80211_iterate_stations_atomic(hw, mt7996_mac_reset_sta_iter, dev);
2488+
mt76_reset_device(&dev->mt76);
24882489
ieee80211_iterate_active_interfaces_atomic(hw,
24892490
IEEE80211_IFACE_SKIP_SDATA_NOT_IN_DRIVER,
24902491
mt7996_mac_reset_vif_iter, dev);
2491-
mt76_reset_device(&dev->mt76);
24922492

24932493
INIT_LIST_HEAD(&dev->sta_rc_list);
24942494
INIT_LIST_HEAD(&dev->twt_list);

0 commit comments

Comments
 (0)