mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] usb: musb: musb_gadget: Fix error path
@ 2010-10-02  6:35 Rahul Ruikar
  2010-10-02  7:54 ` Ming Lei
  2010-11-05 12:19 ` Felipe Balbi
  0 siblings, 2 replies; 3+ messages in thread
From: Rahul Ruikar @ 2010-10-02  6:35 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, Ming Lei, Sergei Shtylyov,
	Mike Frysinger
  Cc: linux-usb, linux-kernel, Rahul Ruikar

In function musb_gadget_setup()
call put_device() when device_register() fails.

Signed-off-by: Rahul Ruikar <rahul.ruikar@gmail.com>
---
 drivers/usb/musb/musb_gadget.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index d065e23..9fdd852 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1676,8 +1676,10 @@ int __init musb_gadget_setup(struct musb *musb)
 	musb_platform_try_idle(musb, 0);
 
 	status = device_register(&musb->g.dev);
-	if (status != 0)
+	if (status != 0) {
+		put_device(&musb->g.dev);
 		the_gadget = NULL;
+	}
 	return status;
 }
 
-- 
1.7.2.3


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-11-05 12:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-02  6:35 [PATCH] usb: musb: musb_gadget: Fix error path Rahul Ruikar
2010-10-02  7:54 ` Ming Lei
2010-11-05 12:19 ` Felipe Balbi

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®