developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 1 | From 6f5c66458edeadf97bd3f6acf55a3a9318b86d83 Mon Sep 17 00:00:00 2001 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 2 | From: MeiChia Chiu <meichia.chiu@mediatek.com> |
| 3 | Date: Thu, 26 Oct 2023 10:08:10 +0800 |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 4 | Subject: [PATCH 009/223] mtk: mt76: mt7996: Fixed null pointer dereference |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 5 | issue |
| 6 | |
| 7 | --- |
| 8 | mt7996/main.c | 7 +++++++ |
| 9 | 1 file changed, 7 insertions(+) |
| 10 | |
| 11 | diff --git a/mt7996/main.c b/mt7996/main.c |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 12 | index f8c07b34..f18c0a08 100644 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 13 | --- a/mt7996/main.c |
| 14 | +++ b/mt7996/main.c |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 15 | @@ -1060,9 +1060,16 @@ static void mt7996_sta_rc_update(struct ieee80211_hw *hw, |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 16 | struct ieee80211_sta *sta, |
| 17 | u32 changed) |
| 18 | { |
| 19 | + struct mt7996_sta *msta = (struct mt7996_sta *)sta->drv_priv; |
| 20 | struct mt7996_phy *phy = mt7996_hw_phy(hw); |
| 21 | struct mt7996_dev *dev = phy->dev; |
| 22 | |
| 23 | + if (!msta->vif) { |
| 24 | + dev_warn(dev->mt76.dev, "Un-initialized STA %pM wcid %d in rc_work\n", |
| 25 | + sta->addr, msta->wcid.idx); |
| 26 | + return; |
| 27 | + } |
| 28 | + |
| 29 | mt7996_sta_rc_work(&changed, sta); |
| 30 | ieee80211_queue_work(hw, &dev->rc_work); |
| 31 | } |
| 32 | -- |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 33 | 2.45.2 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 34 | |