[IPOIB] move the adapter state to active only if the old state is init.
authorsleybo <sleybo@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 28 Nov 2006 07:21:02 +0000 (07:21 +0000)
committersleybo <sleybo@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 28 Nov 2006 07:21:02 +0000 (07:21 +0000)
To prevent the following race:
The adapter start destruction and set the adapter->p_port to NULL.
And bcast_cb set the port to active and use p_adapter->p_port

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

ulp/ipoib/kernel/ipoib_adapter.c

index d31380e..6b1e0b0 100644 (file)
@@ -951,7 +951,7 @@ ipoib_set_active(
        old_state = p_adapter->state;\r
 \r
        /* Change the state to indicate that we are now connected and live. */\r
-       if( old_state != IB_PNP_PORT_REMOVE )\r
+       if( old_state == IB_PNP_PORT_INIT )\r
                p_adapter->state = IB_PNP_PORT_ACTIVE;\r
 \r
        cl_obj_unlock( &p_adapter->obj );\r