* [PATCH] usb: gadget: at91_udc: Fix error path
@ 2010-10-02 7:35 Rahul Ruikar
0 siblings, 0 replies; only message in thread
From: Rahul Ruikar @ 2010-10-02 7:35 UTC (permalink / raw)
To: David Brownell, Greg Kroah-Hartman, Russell King, Harro Haan,
H Hartley Sweeten, Nicolas Ferre, Ryan Mallon
Cc: linux-usb, linux-kernel, Rahul Ruikar
In function at91udc_probe()
call put_device() when device_register() fails.
Signed-off-by: Rahul Ruikar <rahul.ruikar@gmail.com>
---
drivers/usb/gadget/at91_udc.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 93ead19..43178e5 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)
}
retval = device_register(&udc->gadget.dev);
- if (retval < 0)
+ if (retval < 0) {
+ put_device(&udc->gadget.dev);
goto fail0b;
+ }
/* don't do anything until we have both gadget driver and VBUS */
clk_enable(udc->iclk);
--
1.7.2.3
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-10-02 7:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-02 7:35 [PATCH] usb: gadget: at91_udc: 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
all inboxes | Powered by JetHome®