wlan: Protection of active session while disconnecting with spin lock.

[wpa_supplicant]wlan: wlan_hdd_disconnect: Set HDD connState to
                      eConnectionState_Disconnecting
[wpa_supplicant]wlan: wlan_hdd_decr_active_session:
                      No.# of active sessions for mode 2 = 0

If driver calls wlan_hdd_disconnect function and changes
connection state to eConnectionState_Disconnecting, at the
same time if thread context switch happens, hdd_DisConnectHandler
can also decrease active sessions.

[VosMCThread] wlan: ****eCSR_ROAM_DISASSOCIATED****
[VosMCThread] wlan: hdd_DisConnectHandler: Set HDD connState
                    to eConnectionState_Disconnecting from 2
[VosMCThread] wlan: hdd_connSetConnectionState:
                    ConnectionState Changed from oldState:2 to State:5
[VosMCThread] wlan: wlan_hdd_decr_active_session:
                    No.# of active sessions for mode 2 = 255

Here due to thread change, hdd_DisConnectHandler is being called
with connected state and driver will try to decrease active sessions
again.

Fix is to apply spinlock before getting connection state and
after setting connection state.

CRs-Fixed: 704001
Change-Id: I80dfac5324f6731896d5d2ae23d863173c85b455
4 files changed
tree: 0c2f106ca1e8feb30635e017adb7be1b5b7b5b78
  1. CORE/
  2. firmware_bin/
  3. riva/
  4. Android.mk
  5. Kbuild
  6. Kconfig
  7. Makefile