From bf6a341e9a41c8383f7e0abdcb01a1a7d13bcdad Mon Sep 17 00:00:00 2001 From: Lorenzo Bianconi Date: Thu, 14 Dec 2017 09:54:22 +0100 Subject: [PATCH] mt76x2: mac: fix possible NULL pointer dereferencing in mt76x2_mac_write_txwi() Signed-off-by: Lorenzo Bianconi --- mt76x2_mac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mt76x2_mac.c b/mt76x2_mac.c index 6efeec66..073d823a 100644 --- a/mt76x2_mac.c +++ b/mt76x2_mac.c @@ -202,7 +202,7 @@ void mt76x2_mac_write_txwi(struct mt76x2_dev *dev, struct mt76x2_txwi *txwi, } spin_lock_bh(&dev->mt76.lock); - if (rate->idx < 0 || !rate->count) { + if (wcid && (rate->idx < 0 || !rate->count)) { txwi->rate = wcid->tx_rate; max_txpwr_adj = wcid->max_txpwr_adj; nss = wcid->tx_rate_nss;