[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1286081717-2757-1-git-send-email-rahul.ruikar@gmail.com>
Date: Sun, 3 Oct 2010 10:25:17 +0530
From: Rahul Ruikar <rahul.ruikar@...il.com>
To: David Brownell <dbrownell@...rs.sourceforge.net>,
Greg Kroah-Hartman <gregkh@...e.de>,
Michal Nazarewicz <m.nazarewicz@...sung.com>,
Christoph Hellwig <hch@....de>,
Alan Stern <stern@...land.harvard.edu>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
Rahul Ruikar <rahul.ruikar@...il.com>
Subject: [PATCH] usb: gadget: file_storage: Fix error path
call put_device() when device_register() fails.
Signed-off-by: Rahul Ruikar <rahul.ruikar@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists