blob: 089bba00b92cde3426398460445672f819ac18ac [file] [log] [blame]
developerd0c89452024-10-11 16:53:27 +08001From e70e972add40eb5db6463cf156ae19b8dc9bc67c Mon Sep 17 00:00:00 2001
2From: Shayne Chen <shayne.chen@mediatek.com>
3Date: Thu, 5 Sep 2024 15:46:10 +0800
4Subject: [PATCH 193/223] mtk: mt76: mt7996: fix potential crash issue in
5 mt7996_tx_prepare_skb()
6
7This commit aims to fix potential NULL pointer issue of sta, especially
8when the sta keeps conencting and disconneting.
9
10Change-Id: I4407e2b39dd75f161c9cf4d93c652949ca9ddcf6
11Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
12---
13 mt7996/mac.c | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/mt7996/mac.c b/mt7996/mac.c
17index 5d40b8f1..b6980584 100644
18--- a/mt7996/mac.c
19+++ b/mt7996/mac.c
20@@ -947,7 +947,7 @@ int mt7996_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
21 }
22
23 msta = sta ? (struct mt7996_sta *)sta->drv_priv : &mvif->sta;
24- if (ieee80211_is_data_qos(hdr->frame_control) && sta->mlo) {
25+ if ((is_8023 || ieee80211_is_data_qos(hdr->frame_control)) && sta && sta->mlo) {
26 if (unlikely(tx_info->skb->protocol == cpu_to_be16(ETH_P_PAE))) {
27 link_id = msta->pri_link;
28 } else {
29--
302.45.2
31