Skip to content

Commit

Permalink
USB: gadget: amd5536udc.c: fix error path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rahul Ruikar authored and Greg Kroah-Hartman committed Oct 22, 2010
1 parent e581c8c commit f34c25e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/usb/gadget/amd5536udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f34c25e

Please sign in to comment.