* [PATCH 07/14] pcmcia: ds: fix device_register() error handling
@ 2010-09-19 12:54 Vasiliy Kulikov
2010-09-19 13:23 ` Dominik Brodowski
0 siblings, 1 reply; 2+ messages in thread
From: Vasiliy Kulikov @ 2010-09-19 12:54 UTC (permalink / raw)
To: kernel-janitors; +Cc: Dominik Brodowski, linux-pcmcia, 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/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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-09-19 13:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-19 12:54 [PATCH 07/14] pcmcia: ds: fix device_register() error handling Vasiliy Kulikov
2010-09-19 13:23 ` Dominik Brodowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox