[PATCH 134/141] staging: unisys: Hide vbus_hdr_info from public visor_device

Dan Carpenter dan.carpenter at oracle.com
Sat May 9 09:19:28 UTC 2015


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



More information about the devel mailing list