From 95e7e27147525563dfb9add6458f49fd46954ccd Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Thu, 13 Jul 2017 10:51:53 -0700 Subject: [PATCH] qcacmn: Handle no common channel between PCL and the favorite channel list Handle the scenario where no common channel between PCL & the favorite channel list is found. Change-Id: I560d7ef861d89f3f4a0c63afacd0ffbf6aaa976e CRs-Fixed: 2063060 --- .../policy_mgr/src/wlan_policy_mgr_pcl.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c b/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c index 22e8a0b955d7..429873676b74 100644 --- a/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c +++ b/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c @@ -1571,10 +1571,13 @@ QDF_STATUS policy_mgr_get_sap_mandatory_channel(struct wlan_objmgr_psoc *psoc, return status; } - /* No existing SAP connection and hence a new SAP connection might be - * coming up. + /* + * Get inside below loop if no existing SAP connection and hence a new + * SAP connection might be coming up. pcl.pcl_len can be 0 if no common + * channel between PCL & mandatory channel list as well */ - if (!pcl.pcl_len) { + if (!pcl.pcl_len && !policy_mgr_mode_specific_connection_count(psoc, + PM_SAP_MODE, NULL)) { policy_mgr_debug("policy_mgr_get_pcl_for_existing_conn returned no pcl"); status = policy_mgr_get_pcl(psoc, PM_SAP_MODE, pcl.pcl_list, &pcl.pcl_len, @@ -1595,6 +1598,11 @@ QDF_STATUS policy_mgr_get_sap_mandatory_channel(struct wlan_objmgr_psoc *psoc, return status; } + if (!pcl.pcl_len) { + policy_mgr_err("No common channel between mandatory list & PCL"); + return QDF_STATUS_E_FAILURE; + } + *chan = pcl.pcl_list[0]; policy_mgr_debug("mandatory channel:%d", *chan);