From a9518782cd1a930642f80302c628f9c345572946 Mon Sep 17 00:00:00 2001 From: Srinivas Dasari Date: Thu, 17 Jun 2021 19:12:48 +0530 Subject: [PATCH] qcacld-3.0: Send NDI create rsp to userspace after NDI state is set Currently, driver creates the NDI upon userspace request and sends NDI-create-response to userspace. But internal NDI state is set after sending this response. This leads to a race condition when userspace sends NDI delete while driver is still setting driver internal state for NDI create. So, send NDI create response to userspace only after completion of driver internal processing. Change-Id: Ic651fd4f6dfab17c48c4f65b6e5d49c4d08cbe16 CRs-Fixed: 2966549 --- os_if/nan/src/os_if_nan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/os_if/nan/src/os_if_nan.c b/os_if/nan/src/os_if_nan.c index aa2227bc410e..706846e45d25 100644 --- a/os_if/nan/src/os_if_nan.c +++ b/os_if/nan/src/os_if_nan.c @@ -1983,15 +1983,15 @@ static void os_if_ndp_iface_create_rsp_handler(struct wlan_objmgr_psoc *psoc, osif_debug("transaction id: %u status code: %u Reason: %u", create_transaction_id, create_status, create_reason); - cfg80211_vendor_event(vendor_event, GFP_KERNEL); - if (!create_fail) { /* update txrx queues and register self sta */ cb_obj.drv_ndi_create_rsp_handler(wlan_vdev_get_id(vdev), ndi_rsp); + cfg80211_vendor_event(vendor_event, GFP_KERNEL); } else { osif_err("NDI interface creation failed with reason %d", create_reason); + cfg80211_vendor_event(vendor_event, GFP_KERNEL); goto close_ndi; }