[MTHCA] Fix erroneous removal from HCA list for cases where HCA was
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 9 Jun 2006 05:28:33 +0000 (05:28 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 9 Jun 2006 05:28:33 +0000 (05:28 +0000)
never added to list.

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

hw/mthca/kernel/hca_pnp.c

index 4b37e8e..096d4c5 100644 (file)
@@ -854,8 +854,9 @@ __hca_release_resources(
 \r
        HCA_ENTER( HCA_DBG_PNP );\r
 \r
-       if( p_ext->state == HCA_REGISTERED )\r
+       switch( p_ext->state )\r
        {\r
+       case HCA_REGISTERED:\r
                CL_ASSERT( p_ext->ci_ifc.deregister_ca );\r
                CL_ASSERT( p_ext->p_al_dev );\r
                CL_ASSERT( p_ext->p_al_file_obj );\r
@@ -864,10 +865,12 @@ __hca_release_resources(
                /* Release AL's CI interface. */\r
                p_ext->ci_ifc.wdm.InterfaceDereference( p_ext->ci_ifc.wdm.Context );\r
                p_ext->state = HCA_STARTED;\r
-       }\r
 \r
-       /* dequeue HCA  */\r
-       mlnx_hca_remove( &p_ext->hca );\r
+               /* Fall through. */\r
+       case HCA_STARTED:\r
+               /* dequeue HCA  */\r
+               mlnx_hca_remove( &p_ext->hca );\r
+       }\r
 \r
        if( p_ext->pnp_target_entry )\r
        {\r