All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath5k: properly free rx dma descriptors
@ 2009-01-30  0:36 Felix Fietkau
  2009-01-30  8:03 ` Nick Kossifidis
  0 siblings, 1 reply; 2+ messages in thread
From: Felix Fietkau @ 2009-01-30  0:36 UTC (permalink / raw)
  To: linux-wireless; +Cc: John W. Linville, Nick Kossifidis

When freeing rx dma descriptors, use the right buffer size.
Fixes kernel oopses on module unload on ixp4xx and most likely
other platforms as well.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -308,6 +308,19 @@ static inline void ath5k_txbuf_free(stru
 	bf->skb = NULL;
 }
 
+static inline void ath5k_rxbuf_free(struct ath5k_softc *sc,
+				struct ath5k_buf *bf)
+{
+	BUG_ON(!bf);
+	if (!bf->skb)
+		return;
+	pci_unmap_single(sc->pdev, bf->skbaddr, sc->rxbufsize,
+			PCI_DMA_FROMDEVICE);
+	dev_kfree_skb_any(bf->skb);
+	bf->skb = NULL;
+}
+
+
 /* Queues setup */
 static struct 	ath5k_txq *ath5k_txq_setup(struct ath5k_softc *sc,
 				int qtype, int subtype);
@@ -1341,7 +1354,7 @@ ath5k_desc_free(struct ath5k_softc *sc, 
 	list_for_each_entry(bf, &sc->txbuf, list)
 		ath5k_txbuf_free(sc, bf);
 	list_for_each_entry(bf, &sc->rxbuf, list)
-		ath5k_txbuf_free(sc, bf);
+		ath5k_rxbuf_free(sc, bf);
 
 	/* Free memory associated with all descriptors */
 	pci_free_consistent(pdev, sc->desc_len, sc->desc, sc->desc_daddr);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-30  8:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-30  0:36 [PATCH] ath5k: properly free rx dma descriptors Felix Fietkau
2009-01-30  8:03 ` Nick Kossifidis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.