Wlan: Add IBSS sta in sta hash once sta is registered

In IBSS case, sta is added by MC thread in hash table before
wma queue locks are initialized for the staid.

As soon as sta is added in sta hash, iperf thread can call
hdd_ibss_hard_start_xmit for the staid and try to acquire wma
queue lock.

A situation may arise where iperf thread tries to acquire lock
but MC thread have not initialized it yet.

To avoid this add the sta in the hash after sta registration is
completed and queue locks are initialized.

Change-Id: Iaaf27633adbfd2b96a858dc1137431d1174a4d1f
CRs-Fixed: 973777
diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c
index 9f7639b..d8b6555 100644
--- a/CORE/HDD/src/wlan_hdd_assoc.c
+++ b/CORE/HDD/src/wlan_hdd_assoc.c
@@ -2669,13 +2669,6 @@
                     MAC_ADDR_ARRAY(pHddStaCtx->conn_info.bssId),
                     pRoamInfo->staId );
 
-         if ( !roamSaveIbssStation( pAdapter, pRoamInfo->staId, (v_MACADDR_t *)pRoamInfo->peerMac ) )
-         {
-            VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN,
-                       "New IBSS peer but we already have the max we can handle.  Can't register this one" );
-            break;
-         }
-
          pHddCtx->sta_to_adapter[pRoamInfo->staId] = pAdapter;
 
          pHddCtx->sta_to_adapter[IBSS_BROADCAST_STAID] = pAdapter;
@@ -2694,6 +2687,13 @@
                "Cannot register STA with TL for IBSS.  Failed with vosStatus = %d [%08X]",
                vosStatus, vosStatus );
          }
+         if (!roamSaveIbssStation(pAdapter,
+               pRoamInfo->staId,
+               (v_MACADDR_t *)pRoamInfo->peerMac))
+         {
+            hddLog(LOGW, FL("Not Able to add sta in sta hash"));
+            break;
+         }
          pHddStaCtx->ibss_sta_generation++;
          memset(&staInfo, 0, sizeof(staInfo));
          staInfo.filled = 0;