Kaynağa Gözat

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
Shashank Reddy Vulupala 1 yıl önce
ebeveyn
işleme
31bcad1b28
1 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  1. 3 1
      umac/scan/core/src/wlan_scan_manager_6ghz.c

+ 3 - 1
umac/scan/core/src/wlan_scan_manager_6ghz.c

@@ -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: