ath9k: fix dma mapping leak of rx buffer upon rmmod
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Mon, 23 Mar 2009 22:25:01 +0000 (18:25 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Sat, 28 Mar 2009 00:13:19 +0000 (20:13 -0400)
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>
drivers/net/wireless/ath9k/recv.c

index 917bac7af6f67ea3c0cfb9bfda6534f1c8b677f6..71cb18d6757dea78bb829ef94c84f88479c23c29 100644 (file)
@@ -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)