wifi: mt76: mt7996: Fix possible token leak in mt7996_tx_prepare_skb()

If link_conf or link_sta lookup fails in mt7996_tx_prepare_skb routine,
mt7996 driver leaks an already allocated tx token. Fix the issue
releasing the token in case of error.

Fixes: 7ef0c7ad735b0 ("wifi: mt76: mt7996: Implement MLD address translation for EAPOL")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Link: https://patch.msgid.link/20260531-mt7996_tx_prepare_skb-token-leack-v1-1-2b9c9f59ceb1@kernel.org
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Lorenzo Bianconi
2026-06-01 10:31:04 +02:00
committed by Felix Fietkau
parent 2802466a94
commit d8fc8629f2
2 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -998,7 +998,7 @@ mt76_token_release(struct mt76_dev *dev, int token, bool *wake)
#endif
}
if (dev->token_count < dev->token_size - MT76_TOKEN_FREE_THR &&
if (wake && dev->token_count < dev->token_size - MT76_TOKEN_FREE_THR &&
dev->phy.q_tx[0]->blocked)
*wake = true;