]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ath9k: fix dma mapping leak of rx buffer upon rmmod
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Sat, 28 Mar 2009 01:45:02 +0000 (01:45 +0000)
committerChris Wright <chrisw@sous-sol.org>
Thu, 2 Apr 2009 20:55:16 +0000 (13:55 -0700)
upstream commit: 051b919188650fe4c93ca8701183ae88439388f6

We were claiming DMA buffers on the RX tasklet but never
upon a simple module removal.

Cc: stable@kernel.org
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
[chrisw: backport to 2.6.29]
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
drivers/net/wireless/ath9k/recv.c

index 462e08c3d09dc4cf18693f4e39c383a7dc34c580..c114cb7c240619e5d0b379ca48a13b082ed6e273 100644 (file)
@@ -322,8 +322,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) {
+                       pci_unmap_single(sc->pdev,
+                                        bf->bf_buf_addr,
+                                        sc->rx.bufsize,
+                                        DMA_FROM_DEVICE);
                        dev_kfree_skb(skb);
+               }
        }
 
        if (sc->rx.rxdma.dd_desc_len != 0)