From cdcc5e7a6f1947b85ce3581c3e1d2d21ab311f0c Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Tue, 13 Sep 2016 12:45:10 +0530 Subject: [PATCH] qcacld-3.0: Disconnect the session if the connect channel is not valid qcacld-2.0 to qcacld-3.0 propagation If reg domain changes during connection and the connecting channel is not valid, driver may connect to an invalid channel. In this case wlan_hdd_cfg80211_update_bss_db will return NULL and thus sta will not be registered to TL. This will cause RX frames buffered in TL layer and eventually low resource condition. To avoid this schedule a disconnect for the session if wlan_hdd_cfg80211_update_bss_db returns NULL. Change-Id: I72b62ea7d47f53db55daea5725fa833fd1a45fb8 CRs-Fixed: 1034569 --- core/hdd/src/wlan_hdd_assoc.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 1c805a68139e..93a7529b856e 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -2510,10 +2510,26 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter, wlan_hdd_cfg80211_update_bss_db(pAdapter, pRoamInfo); if (NULL == bss) { - pr_err("wlan: Not able to create BSS entry\n"); + hdd_err("wlan: Not able to create BSS entry"); wlan_hdd_netif_queue_control(pAdapter, WLAN_NETIF_CARRIER_OFF, WLAN_CONTROL_PATH); + if (!hddDisconInProgress) { + /* + * Here driver was not able to add bss + * in cfg80211 database this can happen + * if connected channel is not valid, + * i.e reg domain was changed during + * connection. Queue disconnect for the + * session if disconnect is not in + * progress. + */ + hdd_err("Disconnecting..."); + sme_roam_disconnect( + WLAN_HDD_GET_HAL_CTX(pAdapter), + pAdapter->sessionId, + eCSR_DISCONNECT_REASON_UNSPECIFIED); + } return QDF_STATUS_E_FAILURE; } if (pRoamInfo->u.pConnectedProfile->AuthType ==