From: ftillier Date: Thu, 30 Mar 2006 19:37:16 +0000 (+0000) Subject: [IPoIB] ipoib_adapter_reset: Clear PnP handle before deregistration X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=d3b2e4431fd0710f27f8081521076e248b324fd5;p=~shefty%2Frdma-win.git [IPoIB] ipoib_adapter_reset: Clear PnP handle before deregistration 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@264 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/trunk/ulp/ipoib/kernel/ipoib_adapter.c b/trunk/ulp/ipoib/kernel/ipoib_adapter.c index e28aff2e..65f1d882 100644 --- a/trunk/ulp/ipoib/kernel/ipoib_adapter.c +++ b/trunk/ulp/ipoib/kernel/ipoib_adapter.c @@ -721,6 +721,7 @@ ipoib_reset_adapter( IN ipoib_adapter_t* const p_adapter ) { ib_api_status_t status; + ib_pnp_handle_t h_pnp; IPOIB_ENTER( IPOIB_DBG_INIT ); @@ -729,9 +730,9 @@ ipoib_reset_adapter( if( p_adapter->h_pnp ) { - status = p_adapter->p_ifc->dereg_pnp( - p_adapter->h_pnp, __ipoib_pnp_dereg ); - p_adapter->h_pnp = NULL; + h_pnp = p_adapter->h_pnp; + p_adapter->h_pnp = NULL; + status = p_adapter->p_ifc->dereg_pnp( h_pnp, __ipoib_pnp_dereg ); if( status == IB_SUCCESS ) status = IB_NOT_DONE; }