Skip to content

Commit b033242

Browse files
Ming Yen Hsiehgregkh
authored andcommitted
wifi: mt76: mt7925: prevent NULL pointer dereference in mt7925_tx_check_aggr()
[ Upstream commit 83ae3a1 ] Move the NULL check for 'sta' before dereferencing it to prevent a possible crash. Fixes: 44eb173 ("wifi: mt76: mt7925: add link handling in mt7925_txwi_free") Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Link: https://patch.msgid.link/20250904030649.655436-4-mingyen.hsieh@mediatek.com Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent cd85db4 commit b033242

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • drivers/net/wireless/mediatek/mt76/mt7925

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,11 +846,14 @@ static void mt7925_tx_check_aggr(struct ieee80211_sta *sta, struct sk_buff *skb,
846846
bool is_8023;
847847
u16 fc, tid;
848848

849+
if (!sta)
850+
return;
851+
849852
link_sta = rcu_dereference(sta->link[wcid->link_id]);
850853
if (!link_sta)
851854
return;
852855

853-
if (!sta || !(link_sta->ht_cap.ht_supported || link_sta->he_cap.has_he))
856+
if (!(link_sta->ht_cap.ht_supported || link_sta->he_cap.has_he))
854857
return;
855858

856859
tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK;

0 commit comments

Comments
 (0)