[PATCH] usb: gadget: fsl_udc_core: Fix error path
Rahul Ruikar
rahul.ruikar at gmail.com
Sat Oct 2 15:41:36 EST 2010
call put_device() when device_register() fails.
Signed-off-by: Rahul Ruikar <raul.ruikar at gmail.com>
---
drivers/usb/gadget/fsl_udc_core.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
index 08a9a62..491fc7a 100644
--- a/drivers/usb/gadget/fsl_udc_core.c
+++ b/drivers/usb/gadget/fsl_udc_core.c
@@ -2340,8 +2340,10 @@ static int __init fsl_udc_probe(struct platform_device *pdev)
udc_controller->gadget.dev.release = fsl_udc_release;
udc_controller->gadget.dev.parent = &pdev->dev;
ret = device_register(&udc_controller->gadget.dev);
- if (ret < 0)
+ if (ret < 0) {
+ put_device(&udc_controller->gadget.dev);
goto err_free_irq;
+ }
/* setup QH and epctrl for ep0 */
ep0_setup(udc_controller);
--
1.7.2.3
More information about the Linuxppc-dev
mailing list