]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
USB: usbfs: properly clean up the as structure on error paths
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 16 Feb 2010 20:35:07 +0000 (12:35 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 1 Apr 2010 22:52:22 +0000 (15:52 -0700)
commitffa27b3ddf12952737dcf30b83e56e3da4e965bd
treea1a3c408b2c271a45717a66d1f980500fc80f843
parent00400c98e8359ec5ecec199d66fbf25b944b8834
USB: usbfs: properly clean up the as structure on error paths

commit ddeee0b2eec2a51b0712b04de4b39e7bec892a53 upstream.

I notice that the processcompl_compat() function seems to be leaking the
'struct async *as' in the error paths.

I think that the calling convention is fundamentally buggered. The
caller is the one that did the "reap_as()" to get the as thing, the
caller should be the one to free it too.

Freeing it in the caller also means that it very clearly always gets
freed, and avoids the need for any "free in the error case too".

From: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Marcus Meissner <meissner@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/devio.c