public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 04/14] memstick: core: fix device_register() error handling
@ 2010-09-19 12:54 Vasiliy Kulikov
  2010-09-21 22:20 ` Andrew Morton
  0 siblings, 1 reply; 13+ messages in thread
From: Vasiliy Kulikov @ 2010-09-19 12:54 UTC (permalink / raw)
  To: kernel-janitors; +Cc: Andrew Morton, Tejun Heo, Jiri Slaby, linux-kernel

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


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

end of thread, other threads:[~2010-09-23 12:10 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-19 12:54 [PATCH 04/14] memstick: core: fix device_register() error handling Vasiliy Kulikov
2010-09-21 22:20 ` Andrew Morton
2010-09-21 22:49   ` Greg KH
2010-09-22  8:53     ` Kay Sievers
2010-09-22 10:02       ` Boaz Harrosh
2010-09-22 15:47         ` 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     ` Boaz Harrosh
2010-09-22 15:46       ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox