]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: goku_udc: Fix error path
authorDan Carpenter <error27@gmail.com>
Tue, 5 Oct 2010 16:55:34 +0000 (18:55 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 22 Oct 2010 17:22:04 +0000 (10:22 -0700)
commitb3b669facc3f7e6c657673b7d07df887b6a4492f
tree07998aec5e760ec294566b5facac1ff60d0eb6c8
parent5edfa234070454d3b07557573f17b7d883d186dc
usb: gadget: goku_udc: Fix error path

This is based on an initial patch by Rahul Ruikar.

The goku_remove() function can be called before device_register() so it
can call device_unregister() improperly.  Also if the call to
device_register() fails we need to call put_device().

As I was changing the error handling in goku_probe(), I noticed that
the label was "done" but actually if the function succeeds we return
earlier.  I renamed the error path to "err" instead of "done."

Reported-by: Rahul Ruikar <rahul.ruikar@gmail.com>
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/goku_udc.c