[ofw] [PATCH] winverbs: free port array

Sean Hefty sean.hefty at intel.com
Thu Aug 27 11:49:29 PDT 2009


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 at intel.com>
---
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)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: wv-memleak.diff
Type: application/octet-stream
Size: 470 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20090827/8d2e8c71/attachment.obj>


More information about the ofw mailing list