소스 검색

qcacld-3.0: Fix memory leak in case of fw reset stats command

Fix memory leak in case of txrx_fw_st_rst command where
we are not expecting any response from firmware.

CRs-Fixed: 964465
Change-Id: Iad91cb5557ef167d126ef68e07f02445ad7a0b97
Nirav Shah 9 년 전
부모
커밋
e8825e9bac
3개의 변경된 파일11개의 추가작업 그리고 6개의 파일을 삭제
  1. 4 3
      core/dp/ol/inc/ol_txrx_dbg.h
  2. 5 1
      core/dp/txrx/ol_txrx.c
  3. 2 2
      core/wma/src/wma_utils.c

+ 4 - 3
core/dp/ol/inc/ol_txrx_dbg.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014-2015 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011, 2014-2016 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -82,7 +82,7 @@ struct ol_txrx_stats_req {
 
 #define ol_txrx_debug(vdev, debug_specs) 0
 #define ol_txrx_fw_stats_cfg(vdev, type, val) 0
-#define ol_txrx_fw_stats_get(vdev, req) 0
+#define ol_txrx_fw_stats_get(vdev, req, response_expected) 0
 #define ol_txrx_aggr_cfg(vdev, max_subfrms_ampdu, max_subfrms_amsdu) 0
 
 #else /*---------------------------------------------------------------------*/
@@ -95,7 +95,8 @@ void ol_txrx_fw_stats_cfg(ol_txrx_vdev_handle vdev,
 			  uint8_t cfg_stats_type, uint32_t cfg_val);
 
 int ol_txrx_fw_stats_get(ol_txrx_vdev_handle vdev,
-			 struct ol_txrx_stats_req *req);
+			 struct ol_txrx_stats_req *req,
+			 bool response_expected);
 
 int ol_txrx_aggr_cfg(ol_txrx_vdev_handle vdev,
 		     int max_subfrms_ampdu, int max_subfrms_amsdu);

+ 5 - 1
core/dp/txrx/ol_txrx.c

@@ -1965,7 +1965,8 @@ ol_txrx_fw_stats_cfg(ol_txrx_vdev_handle vdev,
 }
 
 A_STATUS
-ol_txrx_fw_stats_get(ol_txrx_vdev_handle vdev, struct ol_txrx_stats_req *req)
+ol_txrx_fw_stats_get(ol_txrx_vdev_handle vdev, struct ol_txrx_stats_req *req,
+			bool response_expected)
 {
 	struct ol_txrx_pdev_t *pdev = vdev->pdev;
 	uint64_t cookie;
@@ -2006,6 +2007,9 @@ ol_txrx_fw_stats_get(ol_txrx_vdev_handle vdev, struct ol_txrx_stats_req *req)
 		while (cdf_semaphore_acquire(pdev->osdev, req->wait.sem_ptr))
 			;
 
+	if (response_expected == false)
+		cdf_mem_free(non_volatile_req);
+
 	return A_OK;
 }
 #endif

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

@@ -1834,7 +1834,7 @@ int32_t wma_txrx_fw_stats_reset(tp_wma_handle wma_handle,
 	}
 	cdf_mem_zero(&req, sizeof(req));
 	req.stats_type_reset_mask = value;
-	ol_txrx_fw_stats_get(vdev, &req);
+	ol_txrx_fw_stats_get(vdev, &req, false);
 
 	return 0;
 }
@@ -1947,7 +1947,7 @@ int32_t wma_set_txrx_fw_stats_level(tp_wma_handle wma_handle,
 	}
 	req.stats_type_upload_mask = l_up_mask;
 
-	ol_txrx_fw_stats_get(vdev, &req);
+	ol_txrx_fw_stats_get(vdev, &req, true);
 
 	return 0;
 }