winverbs: free port array
authorshefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 27 Aug 2009 18:51:37 +0000 (18:51 +0000)
committershefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 27 Aug 2009 18:51:37 +0000 (18:51 +0000)
Fix a memory leak.  We need to free the port array, which is allocated separately from the device structure.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2386 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/winverbs/kernel/wv_device.c

index 5cc20bd..846f0b0 100644 (file)
@@ -367,6 +367,9 @@ static void WvDeviceFreePorts(WV_DEVICE *pDevice)
                WdfIoQueuePurgeSynchronously(pDevice->pPorts[i].Queue);\r
                WdfObjectDelete(pDevice->pPorts[i].Queue);\r
        }\r
+       if (pDevice->pPorts != NULL) {\r
+               ExFreePoolWithTag(pDevice->pPorts, 'cpvw');\r
+       }\r
 }\r
 \r
 void WvDeviceFree(WV_DEVICE *pDevice)\r