From: Rahul Ruikar <rahul.ruikar@gmail.com>
To: David Brownell <dbrownell@users.sourceforge.net>,
Greg Kroah-Hartman <gregkh@suse.de>,
Michal Nazarewicz <m.nazarewicz@samsung.com>,
Kyungmin Park <kyungmin.park@samsung.com>,
Peter Korsgaard <jacmet@sunsite.dk>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Rahul Ruikar <rahul.ruikar@gmail.com>
Subject: [PATCH] usb: gadget: f_mass_storage: Fix error path
Date: Sun, 3 Oct 2010 10:41:58 +0530 [thread overview]
Message-ID: <1286082718-2874-1-git-send-email-rahul.ruikar@gmail.com> (raw)
call put_device() when device_register() fails.
Signed-off-by: Rahul Ruikar <rahul.ruikar@gmail.com>
---
drivers/usb/gadget/f_mass_storage.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index 32cce02..fd634e1 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -2759,6 +2759,7 @@ static struct fsg_common *fsg_common_init(struct fsg_common *common,
if (rc) {
INFO(common, "failed to register LUN%d: %d\n", i, rc);
common->nluns = i;
+ put_device(&curlun->dev);
goto error_release;
}
--
1.7.2.3
reply other threads:[~2010-10-03 5:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1286082718-2874-1-git-send-email-rahul.ruikar@gmail.com \
--to=rahul.ruikar@gmail.com \
--cc=dbrownell@users.sourceforge.net \
--cc=gregkh@suse.de \
--cc=jacmet@sunsite.dk \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=m.nazarewicz@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®