aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath5k/base.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index bd2c580d1f19..f9d486ff04f2 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -310,6 +310,19 @@ static inline void ath5k_txbuf_free(struct ath5k_softc *sc,
310 bf->skb = NULL; 310 bf->skb = NULL;
311} 311}
312 312
313static inline void ath5k_rxbuf_free(struct ath5k_softc *sc,
314 struct ath5k_buf *bf)
315{
316 BUG_ON(!bf);
317 if (!bf->skb)
318 return;
319 pci_unmap_single(sc->pdev, bf->skbaddr, sc->rxbufsize,
320 PCI_DMA_FROMDEVICE);
321 dev_kfree_skb_any(bf->skb);
322 bf->skb = NULL;
323}
324
325
313/* Queues setup */ 326/* Queues setup */
314static struct ath5k_txq *ath5k_txq_setup(struct ath5k_softc *sc, 327static struct ath5k_txq *ath5k_txq_setup(struct ath5k_softc *sc,
315 int qtype, int subtype); 328 int qtype, int subtype);
@@ -1343,7 +1356,7 @@ ath5k_desc_free(struct ath5k_softc *sc, struct pci_dev *pdev)
1343 list_for_each_entry(bf, &sc->txbuf, list) 1356 list_for_each_entry(bf, &sc->txbuf, list)
1344 ath5k_txbuf_free(sc, bf); 1357 ath5k_txbuf_free(sc, bf);
1345 list_for_each_entry(bf, &sc->rxbuf, list) 1358 list_for_each_entry(bf, &sc->rxbuf, list)
1346 ath5k_txbuf_free(sc, bf); 1359 ath5k_rxbuf_free(sc, bf);
1347 1360
1348 /* Free memory associated with all descriptors */ 1361 /* Free memory associated with all descriptors */
1349 pci_free_consistent(pdev, sc->desc_len, sc->desc, sc->desc_daddr); 1362 pci_free_consistent(pdev, sc->desc_len, sc->desc, sc->desc_daddr);