From 3dfcb4048696baa43fd97b34d312b1b83ebae865 Mon Sep 17 00:00:00 2001 From: Srinivas Dasari Date: Fri, 10 Jun 2022 12:17:51 +0530 Subject: [PATCH] qcacld-3.0: Peer may not be present if NDP confirm fails NDP peer gets created as part of NDP indication in case of NDP initiator. But NDP may fail to form due to various reasons and firmware may send NDP confirm with reject status in such cases instead of NDP indication event. Below is the detailed scenario, 1. On initiator side, it has sent an NDP request and is waiting for NDP response. 2. On responder side, application/framework is preparing to send NDP response with reject due to some config mismatch. At the same time, NDP termination is also issued. So NDP termination frame is sent successfully. 3. Initiator firmware receives this NDP end and it sends an NDP confirm with REJECT to the host and it shall clean-up the session. Currrently, there is a check for the peer existence while indicating this NDP confirm status to framework. There is no need of this check in such failure cases as peer is not yet created. Change-Id: Ibe94a5b67df1ce3d65eaf2ef37b11b08155752c9 CRs-Fixed: 3086975 --- components/nan/core/src/nan_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/nan/core/src/nan_main.c b/components/nan/core/src/nan_main.c index 80a30d2c1c27..26bfcce48b7d 100644 --- a/components/nan/core/src/nan_main.c +++ b/components/nan/core/src/nan_main.c @@ -563,11 +563,13 @@ static QDF_STATUS nan_handle_confirm(struct nan_datapath_confirm_event *confirm) peer = wlan_objmgr_get_peer_by_mac(psoc, confirm->peer_ndi_mac_addr.bytes, WLAN_NAN_ID); - if (!peer) { + if (!peer && confirm->rsp_code == NAN_DATAPATH_RESPONSE_ACCEPT) { nan_debug("Drop NDP confirm as peer isn't available"); return QDF_STATUS_E_NULL_VALUE; } - wlan_objmgr_peer_release_ref(peer, WLAN_NAN_ID); + + if (peer) + wlan_objmgr_peer_release_ref(peer, WLAN_NAN_ID); psoc_nan_obj = nan_get_psoc_priv_obj(psoc); if (!psoc_nan_obj) {