developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 1 | From e70e972add40eb5db6463cf156ae19b8dc9bc67c Mon Sep 17 00:00:00 2001 |
| 2 | From: Shayne Chen <shayne.chen@mediatek.com> |
| 3 | Date: Thu, 5 Sep 2024 15:46:10 +0800 |
| 4 | Subject: [PATCH 193/223] mtk: mt76: mt7996: fix potential crash issue in |
| 5 | mt7996_tx_prepare_skb() |
| 6 | |
| 7 | This commit aims to fix potential NULL pointer issue of sta, especially |
| 8 | when the sta keeps conencting and disconneting. |
| 9 | |
| 10 | Change-Id: I4407e2b39dd75f161c9cf4d93c652949ca9ddcf6 |
| 11 | Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> |
| 12 | --- |
| 13 | mt7996/mac.c | 2 +- |
| 14 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 15 | |
| 16 | diff --git a/mt7996/mac.c b/mt7996/mac.c |
| 17 | index 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 | -- |
| 30 | 2.45.2 |
| 31 | |