iwlagn: fix cmd queue unmap
authorJohannes Berg <johannes.berg@intel.com>
Wed, 22 Jun 2011 11:25:57 +0000 (04:25 -0700)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Fri, 24 Jun 2011 18:54:30 +0000 (11:54 -0700)
When we stop the device while a command is in
flight that uses multiple TBs, we can leak the
DMA buffers for the second and higher TBs. Fix
this by using iwlagn_unmap_tfd() as we do when
we normally recover the entry.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
drivers/net/wireless/iwlwifi/iwl-tx.c

index fd8aee9972c1663ccd7a9d0ba32d762c283c5d6a..cf8fc9afa1eaa5c0b30e4c6d3c8f43d8755cbaa2 100644 (file)
@@ -309,10 +309,7 @@ void iwl_cmd_queue_unmap(struct iwl_priv *priv)
                i = get_cmd_index(q, q->read_ptr);
 
                if (txq->meta[i].flags & CMD_MAPPED) {
-                       dma_unmap_single(priv->bus.dev,
-                                        dma_unmap_addr(&txq->meta[i], mapping),
-                                        dma_unmap_len(&txq->meta[i], len),
-                                        DMA_BIDIRECTIONAL);
+                       iwlagn_unmap_tfd(priv, &txq->meta[i], &txq->tfds[i]);
                        txq->meta[i].flags = 0;
                }