Explorar o código

qcacld-3.0: Add check about num radio

When process hdd_process_ll_stats, the results->num_radio
may be 0 and it causes issue like
"Cannot malloc 0 bytes @ hdd_process_ll_stats:1475"

To resolve this issue, add checking before malloc memory.

Change-Id: I48d4a4045ebdad7465a97417e6514849cf12ef15
CRs-Fixed: 3374212
Paul Zhang %!s(int64=2) %!d(string=hai) anos
pai
achega
0a8f4239ab
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      core/hdd/src/wlan_hdd_stats.c

+ 4 - 0
core/hdd/src/wlan_hdd_stats.c

@@ -1466,6 +1466,10 @@ static void hdd_process_ll_stats(tSirLLStatsResults *results,
 		struct wifi_radio_stats *rs_results, *stat_result;
 		u64 channel_size = 0, pwr_lvl_size = 0;
 		int i;
+
+		if (!results->num_radio)
+			goto exit;
+
 		stats = qdf_mem_malloc(sizeof(*stats));
 		if (!stats)
 			goto exit;