qcacmn: Fill chan_list->num_chan using qdf_min

To avoid array index out of bound for chan_list->chan index use
qdf_min to fill chan_list->num_chan.

CRs-Fixed: 3776519
Change-Id: I33d5059a4f8da6637c2bbf69378cfad5d65ba1b5
This commit is contained in:
Shashank Reddy Vulupala
2024-03-20 18:00:30 +05:30
committed by Ravindra Konda
parent 77a9279a4b
commit 31bcad1b28

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -327,6 +327,8 @@ scm_copy_valid_channels(struct wlan_objmgr_psoc *psoc,
uint8_t i, num_ch = *num_scan_ch;
struct chan_list *chan_list = &req->scan_req.chan_list;
qdf_freq_t freq;
chan_list->num_chan =
qdf_min(chan_list->num_chan, (uint8_t)NUM_CHANNELS);
switch (scan_mode) {
case SCAN_MODE_6G_NO_CHANNEL: