wlan: Delete hash entry only on add sta failure

In SAP mode, association is rejected since peer is in
deny list. In this scenario, del_sta is not sent to
firmware since STA context is not found in
limAssocRspTxCompleteCnf as hash entry is deleted in
limRejectAssociation. This will result in subsequent
add_sta for the same peer to fail.

Fix is to delete hash entry in limRejectAssociation
only on add_sta failure.

Change-Id: I7d8757afb47b26516a0ef6f598e5adbda5b1e86e
CRs-Fixed: 2433402
diff --git a/CORE/MAC/src/pe/lim/limAssocUtils.c b/CORE/MAC/src/pe/lim/limAssocUtils.c
index c20c7a6..1baa061 100644
--- a/CORE/MAC/src/pe/lim/limAssocUtils.c
+++ b/CORE/MAC/src/pe/lim/limAssocUtils.c
@@ -1096,10 +1096,12 @@
             psessionEntry->parsedAssocReq[pStaDs->assocId] = NULL;
         }
 
-        /* Delete hash entry on add sta failure */
-        limReleasePeerIdx(pMac, pStaDs->assocId, psessionEntry);
-        limDeleteDphHashEntry(pMac, pStaDs->staAddr,
-                              pStaDs->assocId,psessionEntry);
+        if (pStaDs->mlmStaContext.mlmState == eLIM_MLM_WT_ADD_STA_RSP_STATE) {
+            /* Delete hash entry on add sta failure */
+            limReleasePeerIdx(pMac, pStaDs->assocId, psessionEntry);
+            limDeleteDphHashEntry(pMac, pStaDs->staAddr,
+                                  pStaDs->assocId,psessionEntry);
+        }
     }
     else
     {