[PATCH v1] wifi: mt76: mt792x: fix memory leak in USB TX path
Devin Wittmayer
lucid_duck at justthetip.ca
Sun Aug 16 18:41:40 PDT 2026
Following up on the first hunk. Looking at that path again, there is a failure
behind it I did not account for on 08-06.
mt76_skb_adjust_pad() calls skb_pad(), which frees the skb on failure, and
today mt76u_tx_queue_skb() correctly returns without touching it. Routing that
exit to err_free_skb: frees it a second time. Special casing does not help,
since skb_cow_head() on the same exit also returns -ENOMEM and is safe.
The prerequisite, in mt76_skb_adjust_pad():
- if (skb_pad(last, pad))
+ if (__skb_pad(last, pad, false))
It reaches mt7925 and SDIO too, so probably its own patch ahead of yours.
Worth flagging as well: mt76s_tx_queue_skb is not a model here, it has the same
two exits and the same missing free.
I have mt7921u here if you want a v2 tested.
Devin
More information about the Linux-mediatek
mailing list