aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/at91_udc.c
diff options
context:
space:
mode:
authorRahul Ruikar <rahul.ruikar@gmail.com>2011-02-09 07:44:28 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-17 13:47:56 -0500
commit8ab10400a037a516cc846c338f879e5bd62497ce (patch)
treedea27c0e6bdef9f9d5ea6ecbf1a492948c94933b /drivers/usb/gadget/at91_udc.c
parentb14e840d04dba211fbdc930247e379085623eacd (diff)
usb: gadget: at91_udc: Fix error path
In function at91udc_probe() call put_device() when device_register() fails. Signed-off-by: Rahul Ruikar <rahul.ruikar@gmail.com> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/at91_udc.c')
-rw-r--r--drivers/usb/gadget/at91_udc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index bdec36acd0fa..bb8ddf0469f9 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1798,8 +1798,10 @@ static int __init at91udc_probe(struct platform_device *pdev)
1798 } 1798 }
1799 1799
1800 retval = device_register(&udc->gadget.dev); 1800 retval = device_register(&udc->gadget.dev);
1801 if (retval < 0) 1801 if (retval < 0) {
1802 put_device(&udc->gadget.dev);
1802 goto fail0b; 1803 goto fail0b;
1804 }
1803 1805
1804 /* don't do anything until we have both gadget driver and VBUS */ 1806 /* don't do anything until we have both gadget driver and VBUS */
1805 clk_enable(udc->iclk); 1807 clk_enable(udc->iclk);