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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux