Browse Source

qcacld-3.0: Reset to NULL after freeing the memory

At IPA UC detach after free IPA TX resource TX comp
ring and TX CE index pointers reset them to NULL.

Change-Id: If6a1b2857d14f5fff2f47e541156ce2c27fb33a3
CRs-Fixed: 2111959
Sravan Kumar Kairam 7 years ago
parent
commit
5662358b2e
1 changed files with 5 additions and 0 deletions
  1. 5 0
      core/dp/htt/htt_tx.c

+ 5 - 0
core/dp/htt/htt_tx.c

@@ -1383,6 +1383,7 @@ free_tx_comp_base:
 							    ipa_uc_tx_rsc.
 							    tx_comp_base),
 							   memctx));
+	pdev->ipa_uc_tx_rsc.tx_comp_ring = NULL;
 free_tx_ce_idx:
 	qdf_mem_free_consistent(pdev->osdev, pdev->osdev->dev,
 				   4,
@@ -1392,6 +1393,8 @@ free_tx_ce_idx:
 							    ipa_uc_tx_rsc.
 							    tx_ce_idx),
 							   memctx));
+	pdev->ipa_uc_tx_rsc.tx_ce_idx = NULL;
+
 	return return_code;
 }
 
@@ -1416,6 +1419,7 @@ int htt_tx_ipa_uc_detach(struct htt_pdev_t *pdev)
 				(&pdev->ipa_uc_tx_rsc.tx_ce_idx),
 				memctx));
 	}
+	pdev->ipa_uc_tx_rsc.tx_ce_idx = NULL;
 
 	if (pdev->ipa_uc_tx_rsc.tx_comp_base.vaddr) {
 		qdf_mem_free_consistent(
@@ -1428,6 +1432,7 @@ int htt_tx_ipa_uc_detach(struct htt_pdev_t *pdev)
 						 tx_comp_base),
 						memctx));
 	}
+	pdev->ipa_uc_tx_rsc.tx_comp_ring = NULL;
 
 	/* Free each single buffer */
 	htt_tx_buf_pool_free(pdev);