iwlegacy: fix dma mappings and skbs leak
[pandora-kernel.git] / drivers / net / wireless / iwlegacy / iwl-4965-tx.c
index 829db91..5c40502 100644 (file)
@@ -698,7 +698,7 @@ void iwl4965_txq_ctx_reset(struct iwl_priv *priv)
  */
 void iwl4965_txq_ctx_stop(struct iwl_priv *priv)
 {
-       int ch;
+       int ch, txq_id;
        unsigned long flags;
 
        /* Turn off all Tx DMA fifos */
@@ -719,6 +719,16 @@ void iwl4965_txq_ctx_stop(struct iwl_priv *priv)
                                        FH_TSSR_TX_STATUS_REG));
        }
        spin_unlock_irqrestore(&priv->lock, flags);
+
+       if (!priv->txq)
+               return;
+
+       /* Unmap DMA from host system and free skb's */
+       for (txq_id = 0; txq_id < priv->hw_params.max_txq_num; txq_id++)
+               if (txq_id == priv->cmd_queue)
+                       iwl_legacy_cmd_queue_unmap(priv);
+               else
+                       iwl_legacy_tx_queue_unmap(priv, txq_id);
 }
 
 /*