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
2017-12-14 16:42:01 +01:00
committed by Felix Fietkau
parent ca5ca8c779
commit 2d4b8f57cc
+1 -1
View File
@@ -235,7 +235,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;