[ofw] memory leak on error flow in winmad and winverb
Uri Habusha
urih at mellanox.co.il
Tue Nov 16 22:57:57 PST 2010
SB
-----Original Message-----
From: Hefty, Sean [mailto:sean.hefty at intel.com]
Sent: Tuesday, November 16, 2010 10:52 PM
To: Uri Habusha; ofw at lists.openfabrics.org; Smith, Stan
Subject: RE: memory leak on error flow in winmad and winverb
> While debugging a BS in winmad I see that a bug with WmCreateControlDevice
> function. When WdfDeviceCreateSymbolicLink and other operation is failed,
> the code calls to WdfObjectDelete but doesn't free the WDF init object
>From the docs:
"If your driver receives a WDFDEVICE_INIT structure from a call to WdfPdoInitAllocate or WdfControlDeviceInitAllocate, and if the driver subsequently encounters an error when it calls a device object initialization method or WdfDeviceCreate, the driver must call WdfDeviceInitFree."
[Uri Habusha] I have to say that this sentence isn't clear. It says what to do when WdfDeviceCreate function is failed. It doesn't say what to do if it success.
"After the driver calls WdfDeviceCreate, it can no longer access the WDFDEVICE_INIT structure"
[Uri Habusha] Is it appears in documentation or is it your interpretation. I didn't found it in my doc (see http://msdn.microsoft.com/en-us/library/ff546050(VS.85).aspx)
I interpret this to mean that once WdfDeviceCreate() succeeds, then there cannot be a call to WdfDeviceInitFree().
[Uri Habusha] okay I can live with that,
- Sean
More information about the ofw
mailing list