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>
This commit is contained in:
Rahul Ruikar 2010-10-20 16:01:51 -07:00 committed by Greg Kroah-Hartman
parent e581c8c8a9
commit f34c25ed78
1 changed files with 3 additions and 1 deletions

View File

@ -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);