소스 검색

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 <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Johannes Berg 15 년 전
부모
커밋
519c7c4168
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      drivers/net/wireless/iwlwifi/iwl-tx.c

+ 1 - 1
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,
 	/* Driver private data, only for Tx (not command) queues,
 	 * not shared with device. */
 	 * not shared with device. */
 	if (id != IWL_CMD_QUEUE_NUM) {
 	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);
 				   TFD_QUEUE_SIZE_MAX, GFP_KERNEL);
 		if (!txq->txb) {
 		if (!txq->txb) {
 			IWL_ERR(priv, "kmalloc for auxiliary BD "
 			IWL_ERR(priv, "kmalloc for auxiliary BD "