@@ -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;