From: Vasiliy Kulikov <segooon@gmail.com>
To: kernel-janitors@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
Tejun Heo <tj@kernel.org>, Jiri Slaby <jirislaby@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 04/14] memstick: core: fix device_register() error handling
Date: Sun, 19 Sep 2010 12:54:49 +0000 [thread overview]
Message-ID: <1284900889-24369-1-git-send-email-segooon@gmail.com> (raw)
If device_register() fails then call put_device().
See comment to device_register.
Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
---
compile tested.
drivers/memstick/core/memstick.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/memstick/core/memstick.c b/drivers/memstick/core/memstick.c
index c00fe82..4303b7e 100644
--- a/drivers/memstick/core/memstick.c
+++ b/drivers/memstick/core/memstick.c
@@ -465,6 +465,7 @@ static void memstick_check(struct work_struct *work)
if (!host->card) {
host->card = card;
if (device_register(&card->dev)) {
+ put_device(&card->dev);
kfree(host->card);
host->card = NULL;
}
--
1.7.0.4
next reply other threads:[~2010-09-19 12:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-19 12:54 Vasiliy Kulikov [this message]
2010-09-21 22:20 ` [PATCH 04/14] memstick: core: fix device_register() error Andrew Morton
2010-09-21 22:49 ` Greg KH
2010-09-22 8:53 ` [PATCH 04/14] memstick: core: fix device_register() error handling Kay Sievers
2010-09-22 10:02 ` Boaz Harrosh
2010-09-22 15:47 ` [PATCH 04/14] memstick: core: fix device_register() error Greg KH
2010-09-22 15:56 ` James Bottomley
2010-09-22 16:20 ` Greg KH
2010-09-22 16:23 ` James Bottomley
2010-09-22 15:50 ` Greg KH
2010-09-23 12:10 ` Vasiliy Kulikov
2010-09-22 9:58 ` [PATCH 04/14] memstick: core: fix device_register() error handling Boaz Harrosh
2010-09-22 15:46 ` [PATCH 04/14] memstick: core: fix device_register() error Greg KH
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=1284900889-24369-1-git-send-email-segooon@gmail.com \
--to=segooon@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=jirislaby@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
/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