From: Arlin Davis Date: Tue, 15 Apr 2014 20:44:16 +0000 (-0700) Subject: Creation of reserved SP moves EP state to DAT_EP_STATE_RESERVED even in failure cases... X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=a6646dbe0a5a1d740e10bbcd09127c7b618b6365;p=~ardavis%2Fdapl.git Creation of reserved SP moves EP state to DAT_EP_STATE_RESERVED even in failure cases. Reserve EP after successfully binding the listening port. Signed-off-by: Arlin Davis --- diff --git a/dapl/common/dapl_rsp_create.c b/dapl/common/dapl_rsp_create.c index 13fe09b..52afcde 100644 --- a/dapl/common/dapl_rsp_create.c +++ b/dapl/common/dapl_rsp_create.c @@ -154,11 +154,6 @@ dapl_rsp_create(IN DAT_IA_HANDLE ia_handle, */ dapl_os_atomic_inc(&((DAPL_EVD *) evd_handle)->evd_ref_count); - /* - * Update the EP state indicating the provider now owns it - */ - ep_ptr->param.ep_state = DAT_EP_STATE_RESERVED; - /* * Set up a listener for a connection. Connections can arrive * even before this call returns! @@ -179,8 +174,7 @@ dapl_rsp_create(IN DAT_IA_HANDLE ia_handle, * wrong! Decrements the EVD refcount & release it. Set * the state to FREE, so we know the call failed. */ - dapl_os_atomic_dec(&((DAPL_EVD *) evd_handle)-> - evd_ref_count); + dapl_os_atomic_dec(&((DAPL_EVD *) evd_handle)->evd_ref_count); sp_ptr->evd_handle = NULL; sp_ptr->state = DAPL_SP_STATE_FREE; dapls_ia_unlink_sp(ia_ptr, sp_ptr); @@ -199,6 +193,11 @@ dapl_rsp_create(IN DAT_IA_HANDLE ia_handle, */ *rsp_handle = (DAT_RSP_HANDLE) sp_ptr; + /* + * Update the EP state indicating the provider now owns it + */ + ep_ptr->param.ep_state = DAT_EP_STATE_RESERVED; + bail: return dat_status; }