wlan: Handle disconnect in connecting state of Wi-Fi.

Disconnect command is being dropped during wifi
connecting state, which results in mismatch of the
wifi states between nl80211 layer and wlan driver.

To mitigate this issue handle disconnect command in
connecting state of wifi.

CRs-Fixed: 582830

Change-Id: I1d80bfdaa8f05bacf67be50647f73252c7fa8b3f
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index c8b3ca8..e3a0273 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -6245,7 +6245,8 @@
     if (NULL != pRoamProfile)
     {
         /*issue disconnect request to SME, if station is in connected state*/
-        if (pHddStaCtx->conn_info.connState == eConnectionState_Associated)
+        if ((pHddStaCtx->conn_info.connState == eConnectionState_Associated) ||
+            (pHddStaCtx->conn_info.connState == eConnectionState_Connecting))
         {
             eCsrRoamDisconnectReason reasonCode =
                                        eCSR_DISCONNECT_REASON_UNSPECIFIED;
@@ -6309,6 +6310,12 @@
                 return -EINVAL;
             }
         }
+        else
+        {
+            hddLog(VOS_TRACE_LEVEL_ERROR, "%s: unexpected cfg disconnect API"
+                   "called while in %d state", __func__,
+                    pHddStaCtx->conn_info.connState);
+        }
     }
     else
     {