From 0a8f4239ab9a728c3fc439f6577e4c6677e999c5 Mon Sep 17 00:00:00 2001 From: Paul Zhang Date: Fri, 6 Jan 2023 11:55:38 +0800 Subject: [PATCH] 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 --- core/hdd/src/wlan_hdd_stats.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index 6f131a4c10..174f9418f5 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/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;