developer | 1f55fcf | 2024-10-17 14:52:33 +0800 | [diff] [blame^] | 1 | From b3c56d88281c0bf3838c3c35b283a98fc689aa15 Mon Sep 17 00:00:00 2001 |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame] | 2 | From: Shayne Chen <shayne.chen@mediatek.com> |
| 3 | Date: Thu, 5 Sep 2024 15:46:10 +0800 |
developer | 1f55fcf | 2024-10-17 14:52:33 +0800 | [diff] [blame^] | 4 | Subject: [PATCH 192/193] mtk: mt76: mt7996: fix potential crash issue in |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame] | 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 |
developer | 1f55fcf | 2024-10-17 14:52:33 +0800 | [diff] [blame^] | 17 | index 5d40b8f..b698058 100644 |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame] | 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 | |