From: Dan Carpenter Date: Tue, 5 Oct 2010 16:55:34 +0000 (+0200) Subject: usb: gadget: goku_udc: Fix error path X-Git-Tag: v2.6.37-rc1~154^2~45 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=319feaabb6c7ccd90da6e3207563c265da7d21ae;p=pandora-kernel.git 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 Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed