Fix a memory leak.  We need to free the port array, which is allocated
separately from the device structure.

Signed-off-by: Sean Hefty <[email protected]>
---
This should go into winof 2.1

Index: core/winverbs/kernel/wv_device.c
===================================================================
--- core/winverbs/kernel/wv_device.c    (revision 2373)
+++ core/winverbs/kernel/wv_device.c    (working copy)
@@ -367,6 +367,9 @@
                WdfIoQueuePurgeSynchronously(pDevice->pPorts[i].Queue);
                WdfObjectDelete(pDevice->pPorts[i].Queue);
        }
+       if (pDevice->pPorts != NULL) {
+               ExFreePoolWithTag(pDevice->pPorts, 'cpvw');
+       }
 }
 
 void WvDeviceFree(WV_DEVICE *pDevice)

Attachment: wv-memleak.diff
Description: Binary data

_______________________________________________
ofw mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw

Reply via email to