From caebb463d70accecdae40193c171b7377cfa36f9 Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Sat, 29 Dec 2018 09:03:28 +0530 Subject: [PATCH] qcacld-3.0: Fix infinite for loop in wlansap_update_csa_channel_params In wlansap_update_csa_channel_params if channel is not present in op class table the for loop become infinite. Add check to break the loop if BW is 20 and still entry is not found in op class table. Change-Id: I6ef6bc138a8df0e18b54bd16a47eba23b437616d CRs-Fixed: 2373915 --- core/sap/src/sap_module.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index 17309ee47a0d..f2f1c40069d5 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -1177,7 +1177,11 @@ wlansap_update_csa_channel_params(struct sap_context *sap_context, op_class = wlan_reg_dmn_get_opclass_from_channel( mac_ctx->scan.countryCodeCurrent, channel, bw); - if (!op_class) + /* + * Do not continue if bw is 20. This mean channel is not + * found and thus set BW20 for the channel. + */ + if (!op_class && bw > BW20) continue; if (bw == BW80) {