From ac3fd9a04cfcbdbaf3cc94df721110616d1fbbb9 Mon Sep 17 00:00:00 2001 From: Will Huang Date: Wed, 1 Nov 2017 16:18:12 +0800 Subject: [PATCH] qcacld-3.0: Fix sap_num_connected_sta leak When SAP stop and ref-STA reconnect event hit together, the reconnect IPA client connect event add sap_num_connected_sta but SAP stop process clear client STA without send IPA client disconnect event. Fix it by moving hdd_ipa_wlan_evt into hdd_softap_deregister_sta which will also been called when sap stopped. Change-Id: I7abe53e8e395c01df5471697f3370d8b5ae792fb CRs-Fixed: 2136199 --- core/hdd/src/wlan_hdd_hostapd.c | 13 ------------- core/hdd/src/wlan_hdd_softap_tx_rx.c | 7 +++++++ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 0b48b6926d98..83eb2e970850 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -2190,20 +2190,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, hdd_err("Failed to find sta id status: %d", qdf_status); return QDF_STATUS_E_FAILURE; } -#ifdef IPA_OFFLOAD - if (hdd_ipa_is_enabled(hdd_ctx)) { - status = hdd_ipa_wlan_evt(adapter, staId, - HDD_IPA_CLIENT_DISCONNECT, - pSapEvent->sapevt. - sapStationDisassocCompleteEvent. - staMac.bytes); - if (status) { - hdd_err("WLAN_CLIENT_DISCONNECT event failed"); - goto stopbss; - } - } -#endif DPTRACE(qdf_dp_trace_mgmt_pkt(QDF_DP_TRACE_MGMT_PACKET_RECORD, adapter->session_id, QDF_TRACE_DEFAULT_PDEV_ID, diff --git a/core/hdd/src/wlan_hdd_softap_tx_rx.c b/core/hdd/src/wlan_hdd_softap_tx_rx.c index 41dce87b481f..9f09de0f8057 100644 --- a/core/hdd/src/wlan_hdd_softap_tx_rx.c +++ b/core/hdd/src/wlan_hdd_softap_tx_rx.c @@ -861,6 +861,13 @@ QDF_STATUS hdd_softap_deregister_sta(struct hdd_adapter *adapter, adapter->sta_info[staId].sta_mac.bytes); if (adapter->sta_info[staId].in_use) { + if (hdd_ipa_uc_is_enabled(hdd_ctx)) { + hdd_ipa_wlan_evt(adapter, + adapter->sta_info[staId].sta_id, + HDD_IPA_CLIENT_DISCONNECT, + adapter->sta_info[staId].sta_mac. + bytes); + } spin_lock_bh(&adapter->sta_info_lock); qdf_mem_zero(&adapter->sta_info[staId], sizeof(struct hdd_station_info));