From: Felix Fietkau Date: Thu, 25 Oct 2018 12:23:13 +0000 (+0200) Subject: mt76: mt76x02: skip station tx status for non-sta wcid entries X-Git-Tag: v5.4-rc1~1957^2~19^2~45^2~33 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=65b526a108264aeac769ec82cf33e5f966c9a1df;p=platform%2Fkernel%2Flinux-rpi.git mt76: mt76x02: skip station tx status for non-sta wcid entries Fixes a crash that could occur if a frame is sent to a station, but the station's wcid was not used (e.g. for software encrypted mgmt tx) Signed-off-by: Felix Fietkau --- diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c index 34fc9f2..ad8df68 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c @@ -450,7 +450,7 @@ void mt76x02_send_tx_status(struct mt76x02_dev *dev, if (stat->wcid < ARRAY_SIZE(dev->mt76.wcid)) wcid = rcu_dereference(dev->mt76.wcid[stat->wcid]); - if (wcid) { + if (wcid && wcid->sta) { void *priv; priv = msta = container_of(wcid, struct mt76x02_sta, wcid);