summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorRahul Ruikar <rahul.ruikar@gmail.com>2010-10-20 16:01:51 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-22 10:22:19 -0700
commitf34c25ed78df6d1297db2187bf5e58aaf6674183 (patch)
tree2326030c09f15b051e9aea5c3c5f658d83634eb0 /drivers/usb
parente581c8c8a957776db452afe316706242abcc1cdc (diff)
downloadlinux-stable-f34c25ed78df6d1297db2187bf5e58aaf6674183.tar.gz
linux-stable-f34c25ed78df6d1297db2187bf5e58aaf6674183.tar.bz2
linux-stable-f34c25ed78df6d1297db2187bf5e58aaf6674183.zip
USB: gadget: amd5536udc.c: fix error path
In function udc_probe() call put_device() when device_register() fails. Signed-off-by: Rahul Ruikar <rahul.ruikar@gmail.com> Acked-by: Thomas Dahlmann <dahlmann.thomas@arcor.de> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/amd5536udc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
index 2b361500af1e..9034e0344723 100644
--- a/drivers/usb/gadget/amd5536udc.c
+++ b/drivers/usb/gadget/amd5536udc.c
@@ -3383,8 +3383,10 @@ static int udc_probe(struct udc *dev)
udc = dev;
retval = device_register(&dev->gadget.dev);
- if (retval)
+ if (retval) {
+ put_device(&dev->gadget.dev);
goto finished;
+ }
/* timer init */
init_timer(&udc_timer);