Procházet zdrojové kódy

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
Asutosh Mohapatra před 2 roky
rodič
revize
485829ae22
1 změnil soubory, kde provedl 3 přidání a 0 odebrání
  1. 3 0
      core/hdd/src/wlan_hdd_main.c

+ 3 - 0
core/hdd/src/wlan_hdd_main.c

@@ -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));