USB: at91_udc: Cleanup variables after failure in usb_gadget_register_driver()
authorWojtek Kaniewski <wojtekka@toxygen.net>
Fri, 8 Dec 2006 11:23:00 +0000 (03:23 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 20 Dec 2006 18:14:27 +0000 (10:14 -0800)
commit943c441948581bd01ab196a4d32da88bfa0f13ce
treee985bcf811c13a576a4169dde2b2dd8258d1c009
parentbc92c32aa21cf2e8808f8cff0be0a2a653652e92
USB: at91_udc: Cleanup variables after failure in usb_gadget_register_driver()

This patch zeroes some variables when usb_gadget_register_driver()
fails. gadgetfs does a dummy registration to get the name of the USB
driver and then waits for user-land driver. If someone plugs the cable
in the meantime, bad things happen, because at91_udc has been left in
inconsistent state.

Signed-off-by: Wojtek Kaniewski <wojtekka@toxygen.net>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/at91_udc.c