[VNIC] better check handle before access
authoraestrin <aestrin@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 15 Oct 2006 17:19:24 +0000 (17:19 +0000)
committeraestrin <aestrin@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 15 Oct 2006 17:19:24 +0000 (17:19 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@524 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/inic/kernel/vnic_data.c

index a3706bc..378053b 100644 (file)
@@ -1333,13 +1333,6 @@ data_cleanup(
                pData->pLocalStorage = NULL;\r
        }\r
 \r
                pData->pLocalStorage = NULL;\r
        }\r
 \r
-       if( NdisPacketPoolUsage(pData->h_recv_pkt_pool) != 0)\r
-       {\r
-                       VNIC_TRACE( VNIC_DBG_WARN,\r
-                               ("Recv packet pool is not empty!!!\n") );\r
-                       NdisMSleep(100);\r
-       }\r
-\r
        if(  pData->h_recv_buf_pool )\r
        {\r
                NdisFreeBufferPool( pData->h_recv_buf_pool );\r
        if(  pData->h_recv_buf_pool )\r
        {\r
                NdisFreeBufferPool( pData->h_recv_buf_pool );\r
@@ -1348,6 +1341,12 @@ data_cleanup(
 \r
        if ( pData->h_recv_pkt_pool )\r
        {\r
 \r
        if ( pData->h_recv_pkt_pool )\r
        {\r
+               while( NdisPacketPoolUsage(pData->h_recv_pkt_pool) != 0)\r
+               {\r
+                       VNIC_TRACE( VNIC_DBG_WARN,\r
+                               ("Recv packet pool is not empty!!!\n") );\r
+                       NdisMSleep(100);\r
+               }\r
                NdisFreePacketPool( pData->h_recv_pkt_pool );\r
                pData->h_recv_pkt_pool = NULL;\r
        }\r
                NdisFreePacketPool( pData->h_recv_pkt_pool );\r
                pData->h_recv_pkt_pool = NULL;\r
        }\r