Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65e4b906 authored by Srinivas Dasari's avatar Srinivas Dasari Committed by Rahul Gusain
Browse files

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
parent 358a4dff
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
@@ -543,10 +544,12 @@ static QDF_STATUS nan_handle_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;
	}

	if (peer)
		wlan_objmgr_peer_release_ref(peer, WLAN_NAN_ID);

	psoc_nan_obj = nan_get_psoc_priv_obj(psoc);