qcacmn: Fix memory access out of bounds when sort 6g channel list

In arch 32 platform, the size of rnr_chan_info is 8 bytes, and it only
allocates 4 bytes for each of them. Which cause memory access out of
bounds.

Change-Id: I4f1798c5354c6a76e32bdfed13ade9667465b789
CRs-Fixed: 2827289
This commit is contained in:
Wu Gao 2020-11-26 20:17:09 +08:00 committed by snandini
parent b82e526a72
commit 2f09a8e245

View File

@ -75,7 +75,7 @@ scm_sort_6ghz_channel_list(struct wlan_objmgr_vdev *vdev,
if (tmp_list_count <= 1)
return;
rnr_chan_info = qdf_mem_malloc(sizeof(rnr_chan_info) * tmp_list_count);
rnr_chan_info = qdf_mem_malloc(sizeof(*rnr_chan_info) * tmp_list_count);
if (!rnr_chan_info)
return;