diff mbox series

[v2,2/4] mt76: mt76x02: skip station tx status for non-sta wcid entries

Message ID 20181101094600.37077-2-nbd@nbd.name (mailing list archive)
State Accepted
Delegated to: Kalle Valo
Headers show
Series [v2,1/4] mt76: clean up more unused EXPORT_SYMBOLs | expand

Commit Message

Felix Fietkau Nov. 1, 2018, 9:45 a.m. UTC
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 <nbd@nbd.name>
---
 drivers/net/wireless/mediatek/mt76/mt76x02_mac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
index 34fc9f2eb51f..ad8df680c6a5 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);