瀏覽代碼

iwlwifi: fix memory leak in command queue handling

Also free the array of command pointers and meta data of each
command buffer when command queue is freed.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Reinette Chatre 15 年之前
父節點
當前提交
2814298639
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      drivers/net/wireless/iwlwifi/iwl-tx.c

+ 6 - 0
drivers/net/wireless/iwlwifi/iwl-tx.c

@@ -197,6 +197,12 @@ void iwl_cmd_queue_free(struct iwl_priv *priv)
 		pci_free_consistent(dev, priv->hw_params.tfd_size *
 				    txq->q.n_bd, txq->tfds, txq->q.dma_addr);
 
+	/* deallocate arrays */
+	kfree(txq->cmd);
+	kfree(txq->meta);
+	txq->cmd = NULL;
+	txq->meta = NULL;
+
 	/* 0-fill queue descriptor structure */
 	memset(txq, 0, sizeof(*txq));
 }