qcacmn: Fix array subscript out of bound issue

Fix array indexing greater than array size
which may lead to buffer over-read.

CRs-Fixed: 2616852
Change-Id: I802a64fddaec1dffa8f09284af11c0ebe84b65f0
This commit is contained in:
Karthik Kantamneni
2020-02-05 15:23:08 +05:30
committed by nshrivas
parent a4a994242f
commit 29343ccd79

View File

@@ -713,7 +713,7 @@ int wlan_cfg_get_target_pdev_id(struct wlan_cfg_dp_soc_ctxt *cfg,
{ {
int idx; int idx;
for (idx = 0; idx < MAX_NUM_LMAC_HW; idx++) { for (idx = 0; idx < MAX_PDEV_CNT; idx++) {
if (cfg->hw_macid[idx] == hw_macid) if (cfg->hw_macid[idx] == hw_macid)
return (idx + 1); return (idx + 1);
} }