Skip to content

Commit 93d0694

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 b81a93d commit 93d0694

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
@@ -845,11 +845,14 @@ static void mt7925_tx_check_aggr(struct ieee80211_sta *sta, struct sk_buff *skb,
845845
bool is_8023;
846846
u16 fc, tid;
847847

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

852-
if (!sta || !(link_sta->ht_cap.ht_supported || link_sta->he_cap.has_he))
855+
if (!(link_sta->ht_cap.ht_supported || link_sta->he_cap.has_he))
853856
return;
854857

855858
tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK;

0 commit comments

Comments
 (0)