From a1898067b3aec2cb4a4ce72e59ac8444e9200587 Mon Sep 17 00:00:00 2001 From: Srinivas Dasari Date: Mon, 11 Jan 2021 18:04:13 +0530 Subject: [PATCH] qcacld-3.0: Abort ongoing STA connection when SAP goes down Currently, ongoing STA connection is not aborted when a stop_adapter is received on SAP. This results in a peer leak in the below scenario, 1. Turn on SAP. 2. Initiate STA connection to an SSID which has multiple BSSIDs in dense environment. Connection gets retried to next BSSID when it fails to connect to the current BSSID. 3. Turn off SAP while connection is happening. stop_bss command doesn't get processed and waits in queue as the STA connection is going on. 4. If stop_bss timer(10 seconds) expires while STA connection is in progress, SAP vdev is destroyed without cleaning up self peer. So, there would be a peer leak. Abort the ongoing sta when SAP goes down, so that stop_bss gets processed cleanly and self peer is also cleaned up. Same is applicable for P2P_GO as well. Change-Id: I888a602cd27a9bbec54fb356ed1488cd9fc2847c CRs-Fixed: 2852023 --- core/hdd/src/wlan_hdd_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 46c2adde4df9..7b2293c276e0 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -7190,6 +7190,7 @@ QDF_STATUS hdd_stop_adapter(struct hdd_context *hdd_ctx, case QDF_SAP_MODE: wlan_hdd_scan_abort(adapter); + hdd_abort_ongoing_sta_connection(hdd_ctx); /* Diassociate with all the peers before stop ap post */ if (test_bit(SOFTAP_BSS_STARTED, &adapter->event_flags)) { if (wlan_hdd_del_station(adapter)) @@ -7236,8 +7237,10 @@ QDF_STATUS hdd_stop_adapter(struct hdd_context *hdd_ctx, ACS_COMPLETE_TIMEOUT); } - if (adapter->device_mode == QDF_P2P_GO_MODE) + if (adapter->device_mode == QDF_P2P_GO_MODE) { wlan_hdd_cleanup_remain_on_channel_ctx(adapter); + hdd_abort_ongoing_sta_connection(hdd_ctx); + } hdd_deregister_hl_netdev_fc_timer(adapter); hdd_deregister_tx_flow_control(adapter);