From: Reinette Chatre Date: Fri, 25 Sep 2009 21:24:22 +0000 (-0700) Subject: iwlwifi: fix memory leak in command queue handling X-Git-Tag: v2.6.32-rc3~12^2~48^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2814298639619b0aa994fe1aee55438f1e26a2a8;p=platform%2Fkernel%2Flinux-exynos.git 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 Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index a7422e5..c189075 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/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)); }