wlan: Initialize 'staInfo_lock' before accessing.

staInfo_lock lock is initialized during change_interface or while
opening SAP/P2P-GO adapter. Hence in SSR scenario staInfo_lock will
not be initialized, leading to accessing lock without initialization.

Changes are done to initialize lock in WLANSAP_Start() so that lock
will be initialized in both re_init(SSR) and driver loading.

Change-Id: If71b2748e02f9fbb3e03cdee8dc5a313e142e5bb
CRs-Fixed: 799349
diff --git a/CORE/HDD/src/wlan_hdd_softap_tx_rx.c b/CORE/HDD/src/wlan_hdd_softap_tx_rx.c
index 2db04f4..c39bd0a 100644
--- a/CORE/HDD/src/wlan_hdd_softap_tx_rx.c
+++ b/CORE/HDD/src/wlan_hdd_softap_tx_rx.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -822,8 +822,6 @@
    pAdapter->aTxQueueLimit[WLANTL_AC_VI] = HDD_SOFTAP_TX_VI_QUEUE_MAX_LEN;
    pAdapter->aTxQueueLimit[WLANTL_AC_VO] = HDD_SOFTAP_TX_VO_QUEUE_MAX_LEN;
 
-   spin_lock_init( &pSapCtx->staInfo_lock );
-
    for (STAId = 0; STAId < WLAN_MAX_STA_COUNT; STAId++)
    {
       vos_mem_zero(&pSapCtx->aStaInfo[STAId], sizeof(hdd_station_info_t));
diff --git a/CORE/SAP/src/sapModule.c b/CORE/SAP/src/sapModule.c
index 898c24b..4d8a2c3 100644
--- a/CORE/SAP/src/sapModule.c
+++ b/CORE/SAP/src/sapModule.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -259,7 +259,12 @@
         return VOS_STATUS_E_FAULT;
     }
 
-
+    if (!VOS_IS_STATUS_SUCCESS(vos_spin_lock_init(&pSapCtx->staInfo_lock)))
+    {
+        VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
+                 "WLANSAP_Start failed init staInfo_lock\n");
+        return VOS_STATUS_E_FAULT;
+    }
 
     return VOS_STATUS_SUCCESS;
 }/* WLANSAP_Start */