[PATCH] wifi: mt76: Fix skb reference leak on USB/SDIO tx_queue_skb error paths

Wentao Liang vulab at iscas.ac.cn
Sat Nov 7 06:16:24 PST 2026


Hi Devin,

Sorry for the long delay in replying, and for the time you spent on a
patch that had been generated against an older baseline.

Thank you for the detailed review and for pointing me at Eason's series.
You were right that the USB half was already handled upstream. After
rebasing on v7.4-rc1, I also found that the original patch had been
generated against an older baseline:

- the USB half is already fixed by 82856da2d3b6 ("wifi: mt76: fix memory
  leak in USB TX path"), so I have dropped it;
- the SDIO tx_prepare_skb() error path is already fixed by 808f2767d421
  ("wifi: mt76: mt792x: Fix memory leak in SDIO TX path"), which is why
  that hunk no longer applies to mainline.

What is left is the queue full path in mt76s_tx_queue_skb(). That check
runs before tx_prepare_skb(), so no pktid has been added to wcid->pktid
and there is no status table entry that could be left pointing at the
freed skb. I am sending a v2 that completes the skb through
ieee80211_tx_status_ext(), the same way Eason's USB patch handles its
queue full path.

For transparency: we found the candidate with static analysis tooling,
and used DeepSeek and GPT 6.1 sol to assist with the audit and the fix.

Thanks again for your patience and for the clear explanation of the tx
status table.

Best regards,
Wentao




More information about the Linux-mediatek mailing list