Skip to content

Commit

Permalink
mt76: fix possible NULL pointer dereference in mt76_tx
Browse files Browse the repository at this point in the history
Even if this is not a real issue since mt76_tx is never run with wcid set
to NULL, fix a theoretical NULL pointer dereference in mt76_tx routine

Fixes: db9f11d3433f7 ("mt76: store wcid tx rate info in one u32 reduce locking")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
LorenzoBianconi authored and nbd168 committed May 13, 2021
1 parent 3511fd4 commit aedc314
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tx.c
Expand Up @@ -306,7 +306,7 @@ mt76_tx(struct mt76_phy *phy, struct ieee80211_sta *sta,
skb_set_queue_mapping(skb, qid);
}

if (!(wcid->tx_info & MT_WCID_TX_INFO_SET))
if (wcid && !(wcid->tx_info & MT_WCID_TX_INFO_SET))
ieee80211_get_tx_rates(info->control.vif, sta, skb,
info->control.rates, 1);

Expand Down

0 comments on commit aedc314

Please sign in to comment.