blob: 112f7592be3ca2ae5c3fe8104ca1183005c496dc [file] [log] [blame]
developer1f55fcf2024-10-17 14:52:33 +08001From b3c56d88281c0bf3838c3c35b283a98fc689aa15 Mon Sep 17 00:00:00 2001
developerd0c89452024-10-11 16:53:27 +08002From: Shayne Chen <shayne.chen@mediatek.com>
3Date: Thu, 5 Sep 2024 15:46:10 +0800
developer1f55fcf2024-10-17 14:52:33 +08004Subject: [PATCH 192/193] mtk: mt76: mt7996: fix potential crash issue in
developerd0c89452024-10-11 16:53:27 +08005 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
developer1f55fcf2024-10-17 14:52:33 +080017index 5d40b8f..b698058 100644
developerd0c89452024-10-11 16:53:27 +080018--- 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