mt76: mt7915: fix potential NPE in TXS processing

If skb is null, then don't try to dereference it.

Signed-off-by: Ben Greear <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Ben Greear
2021-09-24 16:54:59 +02:00
committed by Felix Fietkau
parent 56b842b72a
commit 8044311f5d
+3 -1
View File
@@ -1328,7 +1328,7 @@ mt7915_mac_add_txs_skb(struct mt7915_dev *dev, struct mt76_wcid *wcid, int pid,
mt76_tx_status_lock(mdev, &list);
skb = mt76_tx_status_skb_get(mdev, wcid, pid, &list);
if (!skb)
goto out;
goto out_no_skb;
txs = le32_to_cpu(txs_data[0]);
@@ -1416,6 +1416,8 @@ mt7915_mac_add_txs_skb(struct mt7915_dev *dev, struct mt76_wcid *wcid, int pid,
out:
mt76_tx_status_skb_done(mdev, skb, &list);
out_no_skb:
mt76_tx_status_unlock(mdev, &list);
return !!skb;