ath9k: fix dma mapping leak of rx buffer upon rmmod
PATCH v2 1/1 ath9k: fix dma mapping leak of rx buffer upon rmmod
We were claiming DMA buffers on the RX tasklet but never upon a simple module removal.
---
Sorry, forgot to CC stable
drivers/net/wireless/ath9k/recv.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
drivers/net/wireless/ath9k/recv.c +6 -1
@@ -344,8 +344,13 @@ void ath_rx_cleanup(struct ath_softc *sc)list_for_each_entry (bf, &sc->rx.rxbuf, list) { skb = bf->bf_mpdu; -if (skb) +if (skb) { +dma_unmap_single (sc->dev, + bf->bf_buf_addr, + sc->rx.bufsize, +DMA_FROM_DEVICE );dev_kfree_skb (skb); + } }if (sc->rx.rxdma.dd_desc_len !=0 )
Signature · 1 line
1.5.6.4
PATCH v2 1/1 ath9k: fix dma mapping leak of rx buffer upon rmmod
Quoted 20 lines · On Mon, 23 Mar 2009 18:25:01 -0400 "Luis R. Rodriguez"…
We were claiming DMA buffers on the RX tasklet but never upon a simple module removal.
Cc stable at kernel.orgSigned-off-by FUJITA Tomonori <[email protected]>Signed-off-by Luis R. Rodriguez <[email protected]>---
Sorry, forgot to CC stable
drivers/net/wireless/ath9k/recv.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)drivers/net/wireless/ath9k/recv.c +0
-0@@ -344,8 +344,13 @@ void ath_rx_cleanup(struct ath_softc *sc)list_for_each_entry (bf, &sc->rx.rxbuf, list) {
drivers/net/wireless/ath9k/recv.c void ath_rx_cleanup(struct ath_softc *sc) · line 354
Quoted 10 lines
drivers/net/wireless/ath9k/recv.c +6
-1skb = bf->bf_mpdu; -if (skb) +if (skb) { +dma_unmap_single (sc->dev, + bf->bf_buf_addr, + sc->rx.bufsize, +DMA_FROM_DEVICE );dev_kfree_skb (skb); + } }
ath9k uses pci_map/unmap_* families so using dma_map/unmap looks inconsistent. It works though.
I think that my original patch is fine:
PATCH v2 1/1 ath9k: fix dma mapping leak of rx buffer upon rmmod
Quoted 37 lines · FUJITA Tomonori
Quoted 20 lines · On Mon, 23 Mar 2009 18:25:01 -0400 "Luis R. Rodriguez"…
We were claiming DMA buffers on the RX tasklet but never upon a simple module removal.
Cc stable at kernel.orgSigned-off-by FUJITA Tomonori <[email protected]>Signed-off-by Luis R. Rodriguez <[email protected]>---
Sorry, forgot to CC stable
drivers/net/wireless/ath9k/recv.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)drivers/net/wireless/ath9k/recv.c +0
-0@@ -344,8 +344,13 @@ void ath_rx_cleanup(struct ath_softc *sc)list_for_each_entry (bf, &sc->rx.rxbuf, list) {drivers/net/wireless/ath9k/recv.c void ath_rx_cleanup(struct ath_softc *sc) · line 354
Quoted 10 lines
drivers/net/wireless/ath9k/recv.c +6
-1skb = bf->bf_mpdu; -if (skb) +if (skb) { +dma_unmap_single (sc->dev, + bf->bf_buf_addr, + sc->rx.bufsize, +DMA_FROM_DEVICE );dev_kfree_skb (skb); + } }ath9k uses pci_map/unmap_* families so using dma_map/unmap looks inconsistent. It works though.
Quoted 3 lines
I think that my original patch is fine:
Noted -- the ported patch for 2.6.29 will use pci_unmap_single() however this patch was for 2.6.30 where we now have bus-agnostic routines. To get a better idea of how this looks feel free to check out ath9k from the wireless-testing git tree.
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
Luis