diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 18f55b264bbb..e6980d57e9fa 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -4539,13 +4539,6 @@ QDF_STATUS hdd_sme_close_session_callback(uint8_t vdev_id) return QDF_STATUS_NOT_INITIALIZED; } - /* - * For NAN Data interface, the close session results in the final - * indication to the userspace - */ - if (adapter->device_mode == QDF_NDI_MODE) - hdd_ndp_session_end_handler(adapter); - clear_bit(SME_SESSION_OPENED, &adapter->event_flags); /* @@ -4650,9 +4643,6 @@ int hdd_vdev_destroy(struct hdd_adapter *adapter) if (rc) { clear_bit(SME_SESSION_OPENED, &adapter->event_flags); - if (adapter->device_mode == QDF_NDI_MODE) - hdd_ndp_session_end_handler(adapter); - if (status == QDF_STATUS_E_TIMEOUT) { hdd_err("timed out waiting for sme vdev delete"); sme_cleanup_session(hdd_ctx->mac_handle, vdev_id); diff --git a/core/hdd/src/wlan_hdd_nan_datapath.c b/core/hdd/src/wlan_hdd_nan_datapath.c index 7a3f92325638..3a915132d4cb 100644 --- a/core/hdd/src/wlan_hdd_nan_datapath.c +++ b/core/hdd/src/wlan_hdd_nan_datapath.c @@ -797,6 +797,13 @@ void hdd_ndi_drv_ndi_delete_rsp_handler(uint8_t vdev_id) WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER, WLAN_CONTROL_PATH); + /* + * For NAN Data interface, the close session results in the final + * indication to the userspace + */ + if (adapter->device_mode == QDF_NDI_MODE) + hdd_ndp_session_end_handler(adapter); + complete(&adapter->disconnect_comp_var); }