|
@@ -498,7 +498,7 @@ static void wifi_pos_pdev_iterator(struct wlan_objmgr_psoc *psoc,
|
|
|
wifi_pos_ch = &chan_list->chan_info[chan_list->num_channels];
|
|
|
|
|
|
ch_info = (struct channel_power *)qdf_mem_malloc(
|
|
|
- sizeof(*ch_info) * MAX_CHANNELS);
|
|
|
+ sizeof(*ch_info) * NUM_CHANNELS);
|
|
|
if (!ch_info) {
|
|
|
wifi_pos_err("ch_info is null");
|
|
|
return;
|
|
@@ -513,6 +513,12 @@ static void wifi_pos_pdev_iterator(struct wlan_objmgr_psoc *psoc,
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ if ((chan_list->num_channels + num_channels) > NUM_CHANNELS) {
|
|
|
+ wifi_pos_err("Invalid number of channels");
|
|
|
+ qdf_mem_free(ch_info);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
for (i = 0; i < num_channels; i++) {
|
|
|
wifi_pos_ch[i].ch_power.center_freq = ch_info[i].center_freq;
|
|
|
wifi_pos_ch[i].ch_power.chan_num = ch_info[i].chan_num;
|