diff mbox

[2/5] dapl-2.0 - ucm: incorrectly freeing port on passive side after reject

Message ID E3280858FA94444CA49D2BA02341C9830103BF2430@orsmsx506.amr.corp.intel.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Arlin Davis June 16, 2010, 5:21 p.m. UTC
None
diff mbox

Patch

diff --git a/dapl/openib_ucm/cm.c b/dapl/openib_ucm/cm.c
index 806602f..b874c8b 100644
--- a/dapl/openib_ucm/cm.c
+++ b/dapl/openib_ucm/cm.c
@@ -657,10 +657,6 @@  void dapls_cm_release(dp_ib_cm_handle_t cm)
 	if (!cm->sp && cm->msg.sport)
 		ucm_free_port(&cm->hca->ib_trans, ntohs(cm->msg.sport));
 
-	/* server, release local conn id port */
-	if (cm->sp && cm->msg.dport)
-		ucm_free_port(&cm->hca->ib_trans, ntohs(cm->msg.dport));
-
 	/* clean up any UD address handles */
 	if (cm->ah) {
 		ibv_destroy_ah(cm->ah);
@@ -1753,6 +1749,7 @@  dapls_ib_remove_conn_listener(IN DAPL_IA *ia, IN DAPL_SP *sp)
 
 		sp->cm_srvc_handle = NULL;
 		dapli_dequeue_listen(cm);  
+		ucm_free_port(&cm->hca->ib_trans, ntohs(cm->msg.sport));
 		dapls_cm_release(cm);  /* last ref, dealloc */
 	}
 	return DAT_SUCCESS;