wlan: Fix consecutive TDLS connection failure after TDLS add sta failure

Currently, Failure of TDLS add sta is leading to failure of
next consecutive tdls connection.
Fix is to update the failure info to HDD and return error
to supplicant.

Change-Id: I0d46a198f2abb87b4a4350b454deb98c5e3b8211
CRs-Fixed: 958534
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index a116087..c46ea2d 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -10857,13 +10857,19 @@
     ret = wait_for_completion_interruptible_timeout(&pAdapter->tdls_add_station_comp,
            msecs_to_jiffies(WAIT_TIME_TDLS_ADD_STA));
 
-    if (ret <= 0)
+    mutex_lock(&pHddCtx->tdls_lock);
+    pTdlsPeer = wlan_hdd_tdls_find_peer(pAdapter, mac, FALSE);
+
+    if (ret <= 0 || ((pTdlsPeer != NULL) &&
+                     (pTdlsPeer->link_status == eTDLS_LINK_TEARING)))
     {
         VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
-                "%s: timeout waiting for tdls add station indication %ld",
-                __func__, ret);
-        return -EPERM;
+                "%s: timeout waiting for tdls add station indication %ld peer link status %u",
+                __func__, ret, pTdlsPeer->link_status);
+        mutex_unlock(&pHddCtx->tdls_lock);
+        goto error;
     }
+    mutex_unlock(&pHddCtx->tdls_lock);
 
     if ( eHAL_STATUS_SUCCESS != pAdapter->tdlsAddStaStatus)
     {