qcacld-3.0: Avoid calling qdf_mem_malloc for zero unsafe channels

Currently in hdd_init_channel_avoidance api we are proceeding for
malloc without checking unsafe channel count.
To address this issue add check before calling qdf_mem_malloc api
to check if unsafe channel count is greater than 0, otherwise
return from the function.

Change-Id: I4d54a6aa97a141be06695d2455fb5d6aff8db082
CRs-Fixed: 3273502
Este commit está contenido en:
Asutosh Mohapatra
2022-08-23 16:32:51 +05:30
cometido por Madan Koyyalamudi
padre 3e53da2acd
commit 485829ae22

Ver fichero

@@ -11533,6 +11533,9 @@ static void hdd_init_channel_avoidance(struct hdd_context *hdd_ctx)
unsafe_channel_count = QDF_MIN((uint16_t)hdd_ctx->unsafe_channel_count,
(uint16_t)NUM_CHANNELS);
if (!unsafe_channel_count)
return;
unsafe_freq_list = qdf_mem_malloc(
unsafe_channel_count * sizeof(*unsafe_freq_list));