summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2020-07-24 16:13:10 +0200
committerFelix Fietkau <nbd@nbd.name>2020-09-24 18:10:13 +0200
commitc12b7c7944e56e526c0a457282603ebcdd04ca90 (patch)
tree3a19a74a32e9e0527929ef08c01e80aad3175d1a /drivers/net/wireless/mediatek
parent4bf04d33f5b7eea35fcc1a5a9cd61127dfc84ae1 (diff)
mt76: mt7915: fix crash on tx rate report for invalid stations
Check wcid RCU pointer before using it Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7915/mcu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
index 67ac33bc4951..f8f715b30c0b 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
@@ -522,6 +522,9 @@ mt7915_mcu_tx_rate_report(struct mt7915_dev *dev, struct sk_buff *skb)
return;
wcid = rcu_dereference(dev->mt76.wcid[wcidx]);
+ if (!wcid)
+ return;
+
msta = container_of(wcid, struct mt7915_sta, wcid);
stats = &msta->stats;