[ofw] [PATCH 09/12] dapl-2.0: scm: add EP locking and cm checking to socket cm disconnect

Davis, Arlin R arlin.r.davis at intel.com
Wed May 19 11:11:35 PDT 2010


Signed-off-by: Arlin Davis <arlin.r.davis at intel.com>
---
 dapl/openib_scm/cm.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/dapl/openib_scm/cm.c b/dapl/openib_scm/cm.c
index b6ffbe9..afd0d93 100644
--- a/dapl/openib_scm/cm.c
+++ b/dapl/openib_scm/cm.c
@@ -1410,11 +1410,14 @@ dapls_ib_disconnect(IN DAPL_EP * ep_ptr, IN DAT_CLOSE_FLAGS close_flags)
 {
 	dp_ib_cm_handle_t cm_ptr = dapl_get_cm_from_ep(ep_ptr);
 
+	dapl_os_lock(&ep_ptr->header.lock);
 	if (ep_ptr->param.ep_state == DAT_EP_STATE_DISCONNECTED ||
-		ep_ptr->param.ep_attr.service_type != DAT_SERVICE_TYPE_RC) {
+	    ep_ptr->param.ep_attr.service_type != DAT_SERVICE_TYPE_RC ||
+	    cm_ptr == NULL) {
+		dapl_os_unlock(&ep_ptr->header.lock);
 		return DAT_SUCCESS;
 	} 
-	
+	dapl_os_unlock(&ep_ptr->header.lock);
 	return (dapli_socket_disconnect(cm_ptr));
 }
 
-- 
1.5.2.5




More information about the ofw mailing list