diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c index 00ea97a2da8d..4fd73f5eadde 100644 --- a/core/mac/src/pe/lim/lim_process_tdls.c +++ b/core/mac/src/pe/lim/lim_process_tdls.c @@ -2560,6 +2560,19 @@ static tSirRetStatus lim_tdls_setup_add_sta(tpAniSirGlobal pMac, pStaDs = dph_lookup_hash_entry(pMac, pAddStaReq->peermac.bytes, &aid, &psessionEntry->dph.dphHashTable); + + if (pStaDs && pAddStaReq->tdlsAddOper == TDLS_OPER_ADD) { + pe_err("TDLS entry for peer: "MAC_ADDRESS_STR " already exist, cannot add new entry", + MAC_ADDR_ARRAY(pAddStaReq->peermac.bytes)); + return eSIR_FAILURE; + } + + if (pStaDs && pStaDs->staType != STA_ENTRY_TDLS_PEER) { + pe_err("Non TDLS entry for peer: "MAC_ADDRESS_STR " already exist", + MAC_ADDR_ARRAY(pAddStaReq->peermac.bytes)); + return eSIR_FAILURE; + } + if (NULL == pStaDs) { aid = lim_assign_peer_idx(pMac, psessionEntry);