浏览代码

Revert "qcacld-3.0: Fix possible memory leak of tx_time_per_power_level"

This reverts commit I51064734cf97b9ff0ecbbaf27f38d5a223c91d3b.

Change-Id: I4d92646015b06260c16fbaf3ce8dde0ad4ba3308
CRs-Fixed: 3097877
Jingxiang Ge 3 年之前
父节点
当前提交
73868a08d0
共有 1 个文件被更改,包括 11 次插入15 次删除
  1. 11 15
      core/wma/src/wma_utils.c

+ 11 - 15
core/wma/src/wma_utils.c

@@ -1962,23 +1962,19 @@ static int __wma_unified_radio_tx_power_level_stats_event_handler(
 		return -EINVAL;
 	}
 
-	if (rs_results->tx_time_per_power_level) {
-		qdf_mem_free(rs_results->tx_time_per_power_level);
-		rs_results->tx_time_per_power_level = NULL;
-	}
-
-	rs_results->tx_time_per_power_level =
-		qdf_mem_malloc(sizeof(uint32_t) *
-			       rs_results->total_num_tx_power_levels);
 	if (!rs_results->tx_time_per_power_level) {
-		/* In error case, atleast send the radio stats without
-		 * tx_power_level stats
-		 */
-		rs_results->total_num_tx_power_levels = 0;
-		link_stats_results->nr_received++;
-		goto post_stats;
+		rs_results->tx_time_per_power_level =
+			qdf_mem_malloc(sizeof(uint32_t) *
+				       rs_results->total_num_tx_power_levels);
+		if (!rs_results->tx_time_per_power_level) {
+			/* In error case, atleast send the radio stats without
+			 * tx_power_level stats
+			 */
+			rs_results->total_num_tx_power_levels = 0;
+			link_stats_results->nr_received++;
+			goto post_stats;
+		}
 	}
-
 	qdf_mem_copy(&rs_results->tx_time_per_power_level[
 					fixed_param->power_level_offset],
 		tx_power_level_values,