Browse Source

qcacmn: Check mgmt txrx desc element status before put to free list

To avoid double add to free list, check mgmt txrx desc element status
firstly.

Change-Id: Ib8f6f719016e19a76cc4fd1007800abf59ebf872
CRs-Fixed: 2348587
Wu Gao 6 years ago
parent
commit
49bd1b5fa5
1 changed files with 6 additions and 0 deletions
  1. 6 0
      umac/cmn_services/mgmt_txrx/core/src/wlan_mgmt_txrx_main.c

+ 6 - 0
umac/cmn_services/mgmt_txrx/core/src/wlan_mgmt_txrx_main.c

@@ -144,6 +144,12 @@ void wlan_mgmt_txrx_desc_put(
 
 	desc = &mgmt_txrx_pdev_ctx->mgmt_desc_pool.pool[desc_id];
 	qdf_spin_lock_bh(&mgmt_txrx_pdev_ctx->mgmt_desc_pool.desc_pool_lock);
+	if (!desc->in_use) {
+		qdf_spin_unlock_bh(&mgmt_txrx_pdev_ctx->mgmt_desc_pool.
+				   desc_pool_lock);
+		mgmt_txrx_err("desc %d is freed", desc_id);
+		return;
+	}
 	desc->in_use = false;
 	qdf_list_insert_front(&mgmt_txrx_pdev_ctx->mgmt_desc_pool.free_list,
 			      &desc->entry);