developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 1 | From 7384dd7ed2828f0681ce1d765007d3f1976e8760 Mon Sep 17 00:00:00 2001 |
| 2 | From: MeiChia Chiu <meichia.chiu@mediatek.com> |
| 3 | Date: Thu, 26 Oct 2023 10:08:10 +0800 |
| 4 | Subject: [PATCH 021/199] mtk: mt76: mt7996: Fixed null pointer dereference |
| 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 |
| 12 | index cbe8b009..72232994 100644 |
| 13 | --- a/mt7996/main.c |
| 14 | +++ b/mt7996/main.c |
| 15 | @@ -1083,9 +1083,16 @@ static void mt7996_sta_rc_update(struct ieee80211_hw *hw, |
| 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 | -- |
| 33 | 2.18.0 |
| 34 | |