From 51930d5a43806f88b0597bb3a9bbcea704d3494a Mon Sep 17 00:00:00 2001 From: Bala Venkatesh Date: Fri, 26 Apr 2019 16:30:25 +0530 Subject: [PATCH] qcacld-3.0: Don't allow update peer command if peer not found Do not allow tdls peer update command if tdls peer is not found in lim. If peer assoc command is given to FW without peer create, FW will assert. Remove tdls peers in tdls component in case of roaming as peers are deleted in lim as part of roaming. Change-Id: Ie227da682e4d30c9b583881f7e2eaafe91826476 CRs-Fixed: 2441951 --- components/tdls/core/src/wlan_tdls_cmds_process.c | 2 +- core/mac/src/pe/lim/lim_process_tdls.c | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/components/tdls/core/src/wlan_tdls_cmds_process.c b/components/tdls/core/src/wlan_tdls_cmds_process.c index 21b282ece672..1dc706292168 100644 --- a/components/tdls/core/src/wlan_tdls_cmds_process.c +++ b/components/tdls/core/src/wlan_tdls_cmds_process.c @@ -898,7 +898,7 @@ tdls_activate_update_peer(struct tdls_update_peer_request *req) if (QDF_IS_STATUS_ERROR(status)) goto updatersp; - curr_peer = tdls_get_peer(vdev_obj, mac); + curr_peer = tdls_find_peer(vdev_obj, mac); if (!curr_peer) { tdls_err(QDF_MAC_ADDR_STR " not exist. return invalid", QDF_MAC_ADDR_ARRAY(mac)); diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c index 918029805022..9623df21ad7d 100644 --- a/core/mac/src/pe/lim/lim_process_tdls.c +++ b/core/mac/src/pe/lim/lim_process_tdls.c @@ -2552,7 +2552,10 @@ static QDF_STATUS lim_tdls_setup_add_sta(struct mac_context *mac, sta = dph_lookup_hash_entry(mac, pAddStaReq->peermac.bytes, &aid, &pe_session->dph.dphHashTable); - + if (!sta && pAddStaReq->tdls_oper == TDLS_OPER_UPDATE) { + pe_err("TDLS update peer is given without peer creation"); + return QDF_STATUS_E_FAILURE; + } if (sta && pAddStaReq->tdls_oper == TDLS_OPER_ADD) { pe_err("TDLS entry for peer: "QDF_MAC_ADDR_STR " already exist, cannot add new entry", QDF_MAC_ADDR_ARRAY(pAddStaReq->peermac.bytes)); @@ -3169,6 +3172,9 @@ QDF_STATUS lim_delete_tdls_peers(struct mac_context *mac_ctx, lim_check_aid_and_delete_peer(mac_ctx, session_entry); + tgt_tdls_delete_all_peers_indication(mac_ctx->psoc, + session_entry->smeSessionId); + if (lim_is_roam_synch_in_progress(session_entry)) return QDF_STATUS_SUCCESS; /* In case of CSA, Only peers in lim and TDLS component @@ -3182,9 +3188,6 @@ QDF_STATUS lim_delete_tdls_peers(struct mac_context *mac_ctx, smeSessionId); } - tgt_tdls_delete_all_peers_indication(mac_ctx->psoc, - session_entry->smeSessionId); - /* reset the set_state_disable flag */ session_entry->tdls_send_set_state_disable = true; pe_debug("Exit");