diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-07-22 21:53:16 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-07-26 15:32:42 -0400 |
commit | 4cee78614cfa046a26c4fbf313d5bbacb3ad8efc (patch) | |
tree | 0affac977346b9130c960a3c4eec430d3f234025 /drivers/net/wireless | |
parent | ec25acc46a62db98baaa9b221f33b66af09a1964 (diff) |
ath9k: fix yet another buffer leak in the tx aggregation code
When an aggregation session is being cleaned up, while the tx status
for some frames is being processed, the TID is flushed and its buffers
are sent out.
Unfortunately that left the pending un-acked frames unprocessed, thus
leaking buffers. Fix this by reordering the code so that those frames
are processed first, before the TID is flushed.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/xmit.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 21aa5bdb2592..501b72821b4d 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -518,6 +518,14 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
518 | bf = bf_next; | 518 | bf = bf_next; |
519 | } | 519 | } |
520 | 520 | ||
521 | /* prepend un-acked frames to the beginning of the pending frame queue */ | ||
522 | if (!list_empty(&bf_pending)) { | ||
523 | spin_lock_bh(&txq->axq_lock); | ||
524 | list_splice(&bf_pending, &tid->buf_q); | ||
525 | ath_tx_queue_tid(txq, tid); | ||
526 | spin_unlock_bh(&txq->axq_lock); | ||
527 | } | ||
528 | |||
521 | if (tid->state & AGGR_CLEANUP) { | 529 | if (tid->state & AGGR_CLEANUP) { |
522 | if (tid->baw_head == tid->baw_tail) { | 530 | if (tid->baw_head == tid->baw_tail) { |
523 | tid->state &= ~AGGR_ADDBA_COMPLETE; | 531 | tid->state &= ~AGGR_ADDBA_COMPLETE; |
@@ -530,14 +538,6 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
530 | return; | 538 | return; |
531 | } | 539 | } |
532 | 540 | ||
533 | /* prepend un-acked frames to the beginning of the pending frame queue */ | ||
534 | if (!list_empty(&bf_pending)) { | ||
535 | spin_lock_bh(&txq->axq_lock); | ||
536 | list_splice(&bf_pending, &tid->buf_q); | ||
537 | ath_tx_queue_tid(txq, tid); | ||
538 | spin_unlock_bh(&txq->axq_lock); | ||
539 | } | ||
540 | |||
541 | rcu_read_unlock(); | 541 | rcu_read_unlock(); |
542 | 542 | ||
543 | if (needreset) | 543 | if (needreset) |