1 When freeing rx dma descriptors, use the right buffer size.
2 Fixes kernel oopses on module unload on ixp4xx and most likely
3 other platforms as well.
5 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
7 --- a/drivers/net/wireless/ath5k/base.c
8 +++ b/drivers/net/wireless/ath5k/base.c
9 @@ -310,6 +310,19 @@ static inline void ath5k_txbuf_free(stru
13 +static inline void ath5k_rxbuf_free(struct ath5k_softc *sc,
14 + struct ath5k_buf *bf)
19 + pci_unmap_single(sc->pdev, bf->skbaddr, sc->rxbufsize,
20 + PCI_DMA_FROMDEVICE);
21 + dev_kfree_skb_any(bf->skb);
27 static struct ath5k_txq *ath5k_txq_setup(struct ath5k_softc *sc,
28 int qtype, int subtype);
29 @@ -1343,7 +1356,7 @@ ath5k_desc_free(struct ath5k_softc *sc,
30 list_for_each_entry(bf, &sc->txbuf, list)
31 ath5k_txbuf_free(sc, bf);
32 list_for_each_entry(bf, &sc->rxbuf, list)
33 - ath5k_txbuf_free(sc, bf);
34 + ath5k_rxbuf_free(sc, bf);
36 /* Free memory associated with all descriptors */
37 pci_free_consistent(pdev, sc->desc_len, sc->desc, sc->desc_daddr);