diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-07-12 17:16:34 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-07-14 13:52:45 -0400 |
commit | 31e79a5954b78fbed15de2c8974d5a2b6019199a (patch) | |
tree | dd5a3a257ef2d4bcc50c352ca2a938b4acd6cdd7 /drivers/net/wireless/ath/ath9k | |
parent | 57674308d00b5ebb639ce53d388e61728e0c7f72 (diff) |
ath9k: another fix for the A-MPDU buffer leak
The patch 'ath9k: fix a buffer leak in A-MPDU completion' addressed the
issue of running out of buffers/descriptors in the tx path if a STA is
deleted while tx status feedback is still pending.
The remaining issue is that the skbs of the buffers are not reclaimed,
leaving a memory leak.
This patch fixes this issue by running the buffers through
ath_tx_complete_buf(), ensuring that the pending frames counter is also
updated.
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/ath/ath9k')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/xmit.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index bd52ac111795..0644f1e91887 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -329,7 +329,6 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
329 | int isaggr, txfail, txpending, sendbar = 0, needreset = 0, nbad = 0; | 329 | int isaggr, txfail, txpending, sendbar = 0, needreset = 0, nbad = 0; |
330 | bool rc_update = true; | 330 | bool rc_update = true; |
331 | struct ieee80211_tx_rate rates[4]; | 331 | struct ieee80211_tx_rate rates[4]; |
332 | unsigned long flags; | ||
333 | 332 | ||
334 | skb = bf->bf_mpdu; | 333 | skb = bf->bf_mpdu; |
335 | hdr = (struct ieee80211_hdr *)skb->data; | 334 | hdr = (struct ieee80211_hdr *)skb->data; |
@@ -346,9 +345,21 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
346 | if (!sta) { | 345 | if (!sta) { |
347 | rcu_read_unlock(); | 346 | rcu_read_unlock(); |
348 | 347 | ||
349 | spin_lock_irqsave(&sc->tx.txbuflock, flags); | 348 | INIT_LIST_HEAD(&bf_head); |
350 | list_splice_tail_init(bf_q, &sc->tx.txbuf); | 349 | while (bf) { |
351 | spin_unlock_irqrestore(&sc->tx.txbuflock, flags); | 350 | bf_next = bf->bf_next; |
351 | |||
352 | bf->bf_state.bf_type |= BUF_XRETRY; | ||
353 | if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) || | ||
354 | !bf->bf_stale || bf_next != NULL) | ||
355 | list_move_tail(&bf->list, &bf_head); | ||
356 | |||
357 | ath_tx_rc_status(bf, ts, 0, 0, false); | ||
358 | ath_tx_complete_buf(sc, bf, txq, &bf_head, ts, | ||
359 | 0, 0); | ||
360 | |||
361 | bf = bf_next; | ||
362 | } | ||
352 | return; | 363 | return; |
353 | } | 364 | } |
354 | 365 | ||