From 4ce0a1b2b582671919aabb4dfa0f388775578309 Mon Sep 17 00:00:00 2001 From: Yeshwanth Sriram Guntuka Date: Tue, 17 Oct 2017 17:55:45 +0530 Subject: [PATCH] qcacld-3.0: Check sme session opened flag for opened interfaces Sap context memory is allocated on adding softap interface. If wlan interface is disabled after softap interface is added, iface_idle_work is scheduled since DEVICE_IFACE_OPENED will not be set. Memory leak will happen as sap context is not freed in this case. Fix is to check for DEVICE_IFACE_OPENED or SME_SESSION_OPENED flag for opened interfaces. Change-Id: I3585078135dc042222a92cf5c896ad26a086e506 CRs-Fixed: 2126666 --- core/hdd/src/wlan_hdd_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 509e173a2869..d7e14b3bace0 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -4670,7 +4670,9 @@ bool hdd_check_for_opened_interfaces(struct hdd_context *hdd_ctx) status = hdd_get_front_adapter(hdd_ctx, &adapter_node); while ((NULL != adapter_node) && (QDF_STATUS_SUCCESS == status)) { if (test_bit(DEVICE_IFACE_OPENED, - &adapter_node->adapter->event_flags)) { + &adapter_node->adapter->event_flags) || + test_bit(SME_SESSION_OPENED, + &adapter_node->adapter->event_flags)) { hdd_debug("Still other ifaces are up cannot close modules"); close_modules = false; break;