From: Johannes Berg Date: Mon, 17 May 2010 09:37:33 +0000 (-0700) Subject: iwlwifi: kzalloc txb array X-Git-Tag: v2.6.36-rc1~571^2~107^2~320 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=519c7c416870c6e71e9553786a529d89f55ef395;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git iwlwifi: kzalloc txb array When we allocate queues, we currently don't use kzalloc() right now. When we then free those queues again without having used all entries, we may end up trying to free random pointers found in the txb array since it was never initialised. This fixes it simply by using kzalloc(). Signed-off-by: Johannes Berg Signed-off-by: Reinette Chatre --- diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index 769136f..a81989c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c @@ -272,7 +272,7 @@ static int iwl_tx_queue_alloc(struct iwl_priv *priv, /* Driver private data, only for Tx (not command) queues, * not shared with device. */ if (id != IWL_CMD_QUEUE_NUM) { - txq->txb = kmalloc(sizeof(txq->txb[0]) * + txq->txb = kzalloc(sizeof(txq->txb[0]) * TFD_QUEUE_SIZE_MAX, GFP_KERNEL); if (!txq->txb) { IWL_ERR(priv, "kmalloc for auxiliary BD "