]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[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@491 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

trunk/ulp/ipoib/kernel/ipoib_endpoint.c

index 5d885c9645f1452205ec4611f0857c274a855b0a..45aaa0cf7180ec2e02a406170fca659a74de6d09 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