From 84aa12a4e1b0c28d37fbd693b71928c2ad684d9f Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 17 Nov 2018 18:22:33 +0100 Subject: [PATCH] mt76: fix potential null pointer deref in mt76_sta_add Signed-off-by: Felix Fietkau --- mac80211.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mac80211.c b/mac80211.c index d3f94163..b33074cf 100644 --- a/mac80211.c +++ b/mac80211.c @@ -648,6 +648,9 @@ mt76_sta_add(struct mt76_dev *dev, struct ieee80211_vif *vif, for (i = 0; i < ARRAY_SIZE(sta->txq); i++) { struct mt76_txq *mtxq; + if (!sta->txq[i]) + continue; + mtxq = (struct mt76_txq *)sta->txq[i]->drv_priv; mtxq->wcid = wcid;