On Fri, May 08, 2015 at 04:07:03PM +0300, Dan Carpenter wrote:
> > 
> > This function leaks hdr_info on later error paths.
> 
> Never mind.  I'm wrong.  Sorry for the noise.
> 

To be honest, I think I was right originally, but the code is such a
twisty call path that it's hard to tell.

Of course, what I would prefer is to never return half allocated
structs.  Just leave the "vdev->vbus_hdr_info = (void *)hdr_info;" until
we are ready to return success and kfree() it on the error paths.

That way the question "does this leak" is easy to answer.

regards,
dan carpenter

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to