瀏覽代碼

qcacld-3.0: Fix memory leak in wma_utils

Link stats memory is not freed in case of driver
unload happens before more results is received
from firmware.

Fix is to free link stats memory on wma close.

Change-Id: I3c54a0bc4951c70b2ca7116e37e0b62a5c6b7a2f
CRs-Fixed: 2083603
yeshwanth sriram guntuka 7 年之前
父節點
當前提交
584c233dac
共有 3 個文件被更改,包括 3 次插入5 次删除
  1. 1 0
      core/wma/inc/wma_api.h
  2. 1 4
      core/wma/src/wma_main.c
  3. 1 1
      core/wma/src/wma_utils.c

+ 1 - 0
core/wma/inc/wma_api.h

@@ -167,6 +167,7 @@ void wma_set_dbs_capability_ut(uint32_t dbs);
 QDF_STATUS wma_get_caps_for_phyidx_hwmode(struct wma_caps_per_phy *caps_per_phy,
 		enum hw_mode_dbs_capab hw_mode, enum cds_band_type band);
 bool wma_is_rx_ldpc_supported_for_channel(uint32_t channel);
+int wma_unified_radio_tx_mem_free(void *handle);
 
 #if defined(FEATURE_LRO)
 int wma_lro_init(struct cdp_lro_hash_config *lro_config);

+ 1 - 4
core/wma/src/wma_main.c

@@ -3682,10 +3682,7 @@ QDF_STATUS wma_close(void *cds_ctx)
 		wma_handle->pGetRssiReq = NULL;
 	}
 
-	if (wma_handle->link_stats_results) {
-		qdf_mem_free(wma_handle->link_stats_results);
-		wma_handle->link_stats_results = NULL;
-	}
+	wma_unified_radio_tx_mem_free(wma_handle);
 
 	wma_ndp_unregister_all_event_handlers(wma_handle);
 	if (wma_handle->pdev) {

+ 1 - 1
core/wma/src/wma_utils.c

@@ -1259,7 +1259,7 @@ static int wma_unified_link_peer_stats_event_handler(void *handle,
  *
  * Return: 0 on success, error number otherwise.
  */
-static int wma_unified_radio_tx_mem_free(void *handle)
+int wma_unified_radio_tx_mem_free(void *handle)
 {
 	tp_wma_handle wma_handle = (tp_wma_handle) handle;
 	tSirWifiRadioStat *rs_results;