From b6441f2c7280013ad965f6bb570f168e8258acff Mon Sep 17 00:00:00 2001 From: hqu Date: Thu, 9 Aug 2018 16:15:31 +0800 Subject: [PATCH] qcacld-3.0: Initialize weight_copy when weight is SAP_ACS_WEIGHT_MAX When channel 4 is unsafe channel in 2.4g LTE coex ACS case, the weight for channel 4 will be calculated as 0 by function sap_sort_chl_weight_ht40_24_g, it's wrong because weight_copy doesn't be initialized in this case, so acs channel select may choose wrong channel to start sap. Fix is to add initialization for weight_copy when weight is SAP_ACS_WEIGHT_MAX. Change-Id: I4aa0fb133774d9980146a9ceae9b91154bd15bbc CRs-Fixed: 2282371 --- core/sap/src/sap_ch_select.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c index 16f780d72e2f..90cc45201f20 100644 --- a/core/sap/src/sap_ch_select.c +++ b/core/sap/src/sap_ch_select.c @@ -1694,8 +1694,10 @@ static void sap_compute_spect_weight(tSapChSelSpectInfo *pSpectInfoParams, if (rssi < SOFTAP_MIN_RSSI) rssi = SOFTAP_MIN_RSSI; - if (pSpectCh->weight == SAP_ACS_WEIGHT_MAX) + if (pSpectCh->weight == SAP_ACS_WEIGHT_MAX) { + pSpectCh->weight_copy = pSpectCh->weight; goto debug_info; + } /* There may be channels in scanlist, which were not sent to * FW for scanning as part of ACS scan list, but they do have an