[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1284900898-24495-1-git-send-email-segooon@gmail.com>
Date: Sun, 19 Sep 2010 16:54:58 +0400
From: Vasiliy Kulikov <segooon@...il.com>
To: kernel-janitors@...r.kernel.org
Cc: Dominik Brodowski <linux@...inikbrodowski.net>,
linux-pcmcia@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH 07/14] pcmcia: ds: fix device_register() error handling
If device_register() fails then call put_device().
See comment to device_register.
Signed-off-by: Vasiliy Kulikov <segooon@...il.com>
---
compile tested.
drivers/pcmcia/ds.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 100c441..b56f5a6 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -582,10 +582,12 @@ static struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s,
pcmcia_device_query(p_dev);
if (device_register(&p_dev->dev))
- goto err_unreg;
+ goto err_put_device;
return p_dev;
+ err_put_device:
+ put_device(&p_dev->dev);
err_unreg:
mutex_lock(&s->ops_mutex);
list_del(&p_dev->socket_device_list);
--
1.7.0.4
--
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