Index: base/ulp/ipoib/kernel/ipoib_endpoint.c
===================================================================
--- base/ulp/ipoib/kernel/ipoib_endpoint.c	(revision 469)
+++ base/ulp/ipoib/kernel/ipoib_endpoint.c	(working copy)
@@ -408,6 +408,7 @@
 	av_attr.grh.src_gid = p_path->sgid;
 	av_attr.grh.dest_gid = p_path->dgid;
 	
+	cl_obj_lock( &p_port->obj );
 	if( !p_endpt->dlid )
 	{
 		cl_map_item_t	*p_qitem;
@@ -418,12 +419,11 @@
 		 * Insert the item in the LID map so that locally routed unicast
 		 * traffic will resolve it properly.
 		 */
-		cl_obj_lock( &p_port->obj );
 		p_qitem = cl_qmap_insert( &p_port->endpt_mgr.lid_endpts,
 			p_endpt->dlid, &p_endpt->lid_item );
 		CL_ASSERT( p_qitem == &p_endpt->lid_item );
-		cl_obj_unlock( &p_port->obj );
 	}
+	cl_obj_unlock( &p_port->obj );
 	av_attr.static_rate = ib_path_rec_rate( p_path );
 	av_attr.path_bits = 0;
 
