On Sat, May 09, 2015 at 12:19:28PM +0300, Dan Carpenter wrote: > 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. I agree. My patches caused a lot of churn in the code. This patch was to address one of those fallout problems when trying to get things working again. The error paths are still twisty and we haven't quite unraveled them yet. My initial thoughts were that all failures still sent a response to the S-PAR. This means the kfree happened in bus_responder or device_responder. However, looking through the code again, it doesn't always happen that way. I have to check with Unisys to understand why some responses are dropped while others are reported back to the S-PAR. There is still some simplification that needs to happen to make this code easier to read. :-( Thanks for the review. Cheers, Don _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel