mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: file_storage: Fix error path
@ 2010-10-03  4:55 Rahul Ruikar
  2010-10-03 15:59 ` Alan Stern
  2010-10-04  9:39 ` Michał Nazarewicz
  0 siblings, 2 replies; 4+ messages in thread
From: Rahul Ruikar @ 2010-10-03  4:55 UTC (permalink / raw)
  To: David Brownell, Greg Kroah-Hartman, Michal Nazarewicz,
	Christoph Hellwig, Alan Stern, Andrew Morton
  Cc: linux-usb, linux-kernel, Rahul Ruikar

call put_device() when device_register() fails.

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

diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
index a857b7a..2c94318 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -3413,6 +3413,7 @@ static int __ref fsg_bind(struct usb_gadget *gadget)
 
 		if ((rc = device_register(&curlun->dev)) != 0) {
 			INFO(fsg, "failed to register LUN%d: %d\n", i, rc);
+			put_device(&curlun->dev);
 			goto out;
 		}
 		if ((rc = device_create_file(&curlun->dev,
-- 
1.7.2.3


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

end of thread, other threads:[~2010-10-04 11:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-03  4:55 [PATCH] usb: gadget: file_storage: Fix error path Rahul Ruikar
2010-10-03 15:59 ` Alan Stern
2010-10-04  9:39 ` Michał Nazarewicz
2010-10-04 11:33   ` Michał Nazarewicz

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®