* [PATCH] usb: gadget: fsl_udc_core: Fix error path
@ 2010-10-02 5:41 Rahul Ruikar
0 siblings, 0 replies; only message in thread
From: Rahul Ruikar @ 2010-10-02 5:41 UTC (permalink / raw)
To: Li Yang, David Brownell, Greg Kroah-Hartman, Dinh Nguyen,
Anton Vorontsov
Cc: Rahul Ruikar, linux-usb, linuxppc-dev, linux-kernel, Rahul Ruikar
call put_device() when device_register() fails.
Signed-off-by: Rahul Ruikar <raul.ruikar@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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-10-02 5:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-02 5:41 [PATCH] usb: gadget: fsl_udc_core: Fix error path Rahul Ruikar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).