[IPoIB] ipoib_adapter_reset: Clear PnP handle before deregistration
[mirror/winof/.git] / 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