mt76x2: mac: fix possible NULL pointer dereferencing in mt76x2_mac_write_txwi()

Signed-off-by: Lorenzo Bianconi <[email protected]>
This commit is contained in:
Lorenzo Bianconi
2018-01-30 10:23:03 +01:00
committed by Felix Fietkau
parent 0ee431dac9
commit bf6a341e9a
+1 -1
View File
@@ -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;