Skip to content

Commit 0300545

Browse files
committed
wifi: mt76: mt7996: fix crash on some tx status reports
When a wcid can't be found, link_sta can be stale from a previous batch. The code currently assumes that if link_sta is set, wcid is also non-zero. Fix wcid NULL pointer dereference by resetting link_sta when a wcid entry can't be found. Fixes: 62da647 ("wifi: mt76: mt7996: Add MLO support to mt7996_tx_check_aggr()") Link: https://patch.msgid.link/[email protected] Signed-off-by: Felix Fietkau <[email protected]>
1 parent 4be3b46 commit 0300545

File tree

1 file changed

+3
-1
lines changed
  • drivers/net/wireless/mediatek/mt76/mt7996

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,8 +1247,10 @@ mt7996_mac_tx_free(struct mt7996_dev *dev, void *data, int len)
12471247
idx = FIELD_GET(MT_TXFREE_INFO_WLAN_ID, info);
12481248
wcid = mt76_wcid_ptr(dev, idx);
12491249
sta = wcid_to_sta(wcid);
1250-
if (!sta)
1250+
if (!sta) {
1251+
link_sta = NULL;
12511252
goto next;
1253+
}
12521254

12531255
link_sta = rcu_dereference(sta->link[wcid->link_id]);
12541256
if (!link_sta)

0 commit comments

Comments
 (0)