blob: cb70b1b9556f0ce19ad30d9076242ac42fd37cc8 [file] [log] [blame]
developerd0c89452024-10-11 16:53:27 +08001From 6f5c66458edeadf97bd3f6acf55a3a9318b86d83 Mon Sep 17 00:00:00 2001
developer05f3b2b2024-08-19 19:17:34 +08002From: MeiChia Chiu <meichia.chiu@mediatek.com>
3Date: Thu, 26 Oct 2023 10:08:10 +0800
developerd0c89452024-10-11 16:53:27 +08004Subject: [PATCH 009/223] mtk: mt76: mt7996: Fixed null pointer dereference
developer05f3b2b2024-08-19 19:17:34 +08005 issue
6
7---
8 mt7996/main.c | 7 +++++++
9 1 file changed, 7 insertions(+)
10
11diff --git a/mt7996/main.c b/mt7996/main.c
developerd0c89452024-10-11 16:53:27 +080012index f8c07b34..f18c0a08 100644
developer05f3b2b2024-08-19 19:17:34 +080013--- a/mt7996/main.c
14+++ b/mt7996/main.c
developerd0c89452024-10-11 16:53:27 +080015@@ -1060,9 +1060,16 @@ static void mt7996_sta_rc_update(struct ieee80211_hw *hw,
developer05f3b2b2024-08-19 19:17:34 +080016 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--
developerd0c89452024-10-11 16:53:27 +0800332.45.2
developer05f3b2b2024-08-19 19:17:34 +080034