[IPoIB] Fix locking around endpoint LID checks.
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 11 Sep 2006 17:19:28 +0000 (17:19 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 11 Sep 2006 17:19:28 +0000 (17:19 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@491 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/ipoib/kernel/ipoib_endpoint.c

index 5d885c9..45aaa0c 100644 (file)
@@ -408,6 +408,7 @@ __path_query_cb(
        av_attr.grh.src_gid = p_path->sgid;\r
        av_attr.grh.dest_gid = p_path->dgid;\r
        \r
+       cl_obj_lock( &p_port->obj );\r
        if( !p_endpt->dlid )\r
        {\r
                cl_map_item_t   *p_qitem;\r
@@ -418,12 +419,11 @@ __path_query_cb(
                 * Insert the item in the LID map so that locally routed unicast\r
                 * traffic will resolve it properly.\r
                 */\r
-               cl_obj_lock( &p_port->obj );\r
                p_qitem = cl_qmap_insert( &p_port->endpt_mgr.lid_endpts,\r
                        p_endpt->dlid, &p_endpt->lid_item );\r
                CL_ASSERT( p_qitem == &p_endpt->lid_item );\r
-               cl_obj_unlock( &p_port->obj );\r
        }\r
+       cl_obj_unlock( &p_port->obj );\r
        av_attr.static_rate = ib_path_rec_rate( p_path );\r
        av_attr.path_bits = 0;\r
 \r