[IPoIB] ipoib_adapter_reset: Clear PnP handle before deregistration
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 30 Mar 2006 19:37:16 +0000 (19:37 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 30 Mar 2006 19:37:16 +0000 (19:37 +0000)
to close race with __ipoib_pnp_dereg.

Originally submitted by Yossi Leybovich (sleybo@mellanox.co.il)

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@264 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/ipoib/kernel/ipoib_adapter.c

index e28aff2..65f1d88 100644 (file)
@@ -721,6 +721,7 @@ ipoib_reset_adapter(
        IN                              ipoib_adapter_t* const          p_adapter )\r
 {\r
        ib_api_status_t         status;\r
+       ib_pnp_handle_t         h_pnp;\r
 \r
        IPOIB_ENTER( IPOIB_DBG_INIT );\r
 \r
@@ -729,9 +730,9 @@ ipoib_reset_adapter(
 \r
        if( p_adapter->h_pnp )\r
        {\r
-               status = p_adapter->p_ifc->dereg_pnp(\r
-                       p_adapter->h_pnp, __ipoib_pnp_dereg );\r
-               p_adapter->h_pnp = NULL;\r
+               h_pnp = p_adapter->h_pnp;\r
+               p_adapter->h_pnp  = NULL;\r
+               status = p_adapter->p_ifc->dereg_pnp( h_pnp, __ipoib_pnp_dereg );\r
                if( status == IB_SUCCESS )\r
                        status = IB_NOT_DONE;\r
        }\r