USB: usbfs: properly clean up the as structure on error paths
commitfda9759364aea7d1acc8f278e26c98894f5ef52e
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 16 Feb 2010 20:35:07 +0000 (16 12:35 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 23 Feb 2010 15:37:57 +0000 (23 07:37 -0800)
tree7a461ca849ef1046bd503d43f3f1170180e0f6ce
parent2bac497bb2f16f1c01a61a0132d2f7a8dabd0e2a
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