diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 10b679491f2b..72d924f17b9b 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -4549,7 +4549,8 @@ int hdd_vdev_create(struct hdd_adapter *adapter, status = qdf_event_reset(&adapter->qdf_session_open_event); if (QDF_STATUS_SUCCESS != status) { hdd_err("failed to reinit session open event"); - return -EINVAL; + errno = qdf_status_to_os_return(status); + goto objmgr_vdev_destroy_procedure; } errno = hdd_set_sme_session_param(adapter, &sme_session_params, callback, ctx); @@ -4569,17 +4570,14 @@ int hdd_vdev_create(struct hdd_adapter *adapter, status = qdf_wait_for_event_completion(&adapter->qdf_session_open_event, SME_CMD_VDEV_CREATE_DELETE_TIMEOUT); if (QDF_STATUS_SUCCESS != status) { - if (adapter->qdf_session_open_event.force_set) { + if (adapter->qdf_session_open_event.force_set) /* * SSR/PDR has caused shutdown, which has forcefully - * set the event. Return without the closing session. + * set the event. */ - adapter->vdev_id = WLAN_UMAC_VDEV_ID_MAX; hdd_err("Session open event forcefully set"); - return -EINVAL; - } - if (QDF_STATUS_E_TIMEOUT == status) + else if (QDF_STATUS_E_TIMEOUT == status) hdd_err("Session failed to open within timeout period"); else hdd_err("Failed to wait for session open event(status-%d)",