From 3370212bf797e4131f077b552abc877fdb349fb2 Mon Sep 17 00:00:00 2001 From: Hanumanth Reddy Pothula Date: Fri, 7 Oct 2016 17:27:04 +0530 Subject: qcacld-3.0: Invalidate session ID after successful session close Presently, host sets session ID to invalid(0xFF) once it posts the message for sme to close session. During the close session if there are any north bound command pending in queue, Host is sending the command with invalid session ID to firmware, leading to device crash. Set session ID to invalid only once sme session is closed. Change-Id: Ib8a6a8e8a8af842064f6500b4bb62266eae7c1f8 CRs-Fixed: 1074111 --- core/hdd/src/wlan_hdd_hostapd.c | 1 + core/hdd/src/wlan_hdd_main.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 559a6717f3e9..bf299934952b 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -7674,6 +7674,7 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy, global_p2p_connection_status = P2P_NOT_ACTIVE; } #endif + pAdapter->sessionId = HDD_SESSION_ID_INVALID; EXIT(); return ret; } diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 75c5aec1d67f..bfbee90dfc03 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -3463,7 +3463,6 @@ static void hdd_wait_for_sme_close_sesion(hdd_context_t *hdd_ctx, sme_close_session(hdd_ctx->hHal, adapter->sessionId, hdd_sme_close_session_callback, adapter)) { - adapter->sessionId = HDD_SESSION_ID_INVALID; /* * Block on a completion variable. Can't wait * forever though. @@ -3477,7 +3476,9 @@ static void hdd_wait_for_sme_close_sesion(hdd_context_t *hdd_ctx, if (adapter->device_mode == QDF_NDI_MODE) hdd_ndp_session_end_handler(adapter); clear_bit(SME_SESSION_OPENED, &adapter->event_flags); + return; } + adapter->sessionId = HDD_SESSION_ID_INVALID; } } -- cgit v1.2.3