]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
iwlwifi: don't leak Tx skb when a queue is disabled
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Thu, 18 Oct 2012 10:38:37 +0000 (12:38 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 23 Oct 2012 13:24:19 +0000 (15:24 +0200)
Since the queue might not be empty, we need to free the
pending Tx packets.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/iwlwifi/pcie/internal.h
drivers/net/wireless/iwlwifi/pcie/trans.c
drivers/net/wireless/iwlwifi/pcie/tx.c

index 401178f44a3b130a9de6832bf10bd3e9b6e4b529..6ce58f03bc53e96e3d2278f385d1f596164c7841 100644 (file)
@@ -346,6 +346,7 @@ void iwl_txq_free_tfd(struct iwl_trans *trans, struct iwl_tx_queue *txq,
                      enum dma_data_direction dma_dir);
 int iwl_tx_queue_reclaim(struct iwl_trans *trans, int txq_id, int index,
                         struct sk_buff_head *skbs);
+void iwl_tx_queue_unmap(struct iwl_trans *trans, int txq_id);
 int iwl_queue_space(const struct iwl_queue *q);
 
 /*****************************************************
index f95d88df7772014a430f620c889303bf135ff9c3..a6a518116c7fd03e7d5e56fb983f5a11f3990e44 100644 (file)
@@ -442,10 +442,10 @@ static int iwl_trans_txq_init(struct iwl_trans *trans, struct iwl_tx_queue *txq,
        return 0;
 }
 
-/**
+/*
  * iwl_tx_queue_unmap -  Unmap any remaining DMA mappings and free skb's
  */
-static void iwl_tx_queue_unmap(struct iwl_trans *trans, int txq_id)
+void iwl_tx_queue_unmap(struct iwl_trans *trans, int txq_id)
 {
        struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
        struct iwl_tx_queue *txq = &trans_pcie->txq[txq_id];
index db3efbb84d9221d96c933062758504fb74f5f283..5db03145186c5d3333d374c69e91b0711f9818cc 100644 (file)
@@ -494,6 +494,8 @@ void iwl_trans_pcie_txq_disable(struct iwl_trans *trans, int txq_id)
        _iwl_write_targ_mem_dwords(trans, stts_addr,
                                   zero_val, ARRAY_SIZE(zero_val));
 
+       iwl_tx_queue_unmap(trans, txq_id);
+
        IWL_DEBUG_TX_QUEUES(trans, "Deactivate queue %d\n", txq_id);
 }