From 5121951db64f0c0a40079563dff326797578c90f Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Fri, 21 Jun 2019 14:05:15 +0530 Subject: [PATCH] qcacmn: Fix the dfs apply rule logic to filter acs channel list Currently the driver uses i both in outer and inner loop which would corrupt the value of i and the loop would never end. Fix is to use another varibale j for the loop. Change-Id: I6f64fb45d1007621b03fe93cd29da7d4c827a23f CRs-Fixed: 2476402 --- umac/dfs/core/src/misc/dfs_random_chan_sel.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/umac/dfs/core/src/misc/dfs_random_chan_sel.c b/umac/dfs/core/src/misc/dfs_random_chan_sel.c index 734177d469..1ac50a0e5f 100644 --- a/umac/dfs/core/src/misc/dfs_random_chan_sel.c +++ b/umac/dfs/core/src/misc/dfs_random_chan_sel.c @@ -1262,6 +1262,7 @@ static void dfs_apply_rules(struct wlan_dfs *dfs, bool flag_no_japan_w53 = 0; int i; bool found = false; + uint16_t j; dfs_debug(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN, "flags %d", flags); flag_no_weather = (dfs_region == DFS_ETSI_REGION_VAL) ? @@ -1299,8 +1300,8 @@ static void dfs_apply_rules(struct wlan_dfs *dfs, } if (acs_info && acs_info->acs_mode) { - for (i = 0; i < acs_info->num_of_channel; i++) { - if (acs_info->channel_list[i] == + for (j = 0; j < acs_info->num_of_channel; j++) { + if (acs_info->channel_list[j] == chan->dfs_ch_ieee) { found = true; break;