wifi: ath9k: free clone buffer on fi->bf overwrite in ath_tx_setup_buffer
PATCH 1/1 wifi: ath9k: free clone buffer on fi->bf overwrite in ath_tx_setup_buffer
ath_clone_txbuf allocates an ath_buf for the last stale subframe of an A-MPDU and stores it in fi->bf. On retransmission, ath_tx_setup_buffer overwrites fi->bf with the newly allocated buffer without freeing the clone, leaking one ath_buf per aggregate retry that enters the clone path.
Clear the clone's references and return it to the free pool before overwriting fi->bf.
--- drivers/net/wireless/ath/ath9k/xmit.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/wireless/ath/ath9k/xmit.c +5 -0
@@ -2264,6 +2264,11 @@ static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc,return NULL ; } +if (fi->bf) { + fi->bf->bf_mpdu =NULL ; + fi->bf->bf_buf_addr =0 ; +ath_tx_return_buffer (sc, fi->bf); + } fi->bf = bf;return bf;
Signature · 1 line
2.55.0
Toke Høiland-Jørgensen
maintainerQuoted 5 lines · Rosen Penev
ath_clone_txbufallocates anath_buffor the last stale subframe of an A-MPDU and stores it infi->bf. On retransmission,ath_tx_setup_bufferoverwritesfi->bfwith the newly allocated buffer without freeing the clone, leaking oneath_bufper aggregate retry that enters the clone path.
Huh? No, it doesn't - ath_tx_get_tid_subframe() has this:
if (!fi->bf) bf = ath_tx_setup_buffer(sc, txq, tid, skb); else bf->bf_state.stale = false;
-Toke