]> git.baikalelectronics.ru Git - kernel.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>
Tue, 16 Feb 2010 23:11:02 +0000 (15:11 -0800)
commit9a9665a2c082292e7b17ebce17b6fbe5e0ebf909
tree21565d9ce53d9a8ffc3b9ee650305316fda8f0d5
parent167697dac831d6b3e4e0ca81589d4b8821a6cc90
USB: usbfs: properly clean up the as structure on error paths

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>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/devio.c