* [PATCH 05/14] message: i2o: fix device_register() error handling
@ 2010-09-19 12:54 Vasiliy Kulikov
0 siblings, 0 replies; only message in thread
From: Vasiliy Kulikov @ 2010-09-19 12:54 UTC (permalink / raw)
To: kernel-janitors; +Cc: 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/message/i2o/device.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/message/i2o/device.c b/drivers/message/i2o/device.c
index 0ee4264..3ac8ec3 100644
--- a/drivers/message/i2o/device.c
+++ b/drivers/message/i2o/device.c
@@ -234,8 +234,10 @@ static int i2o_device_add(struct i2o_controller *c, i2o_lct_entry *entry)
i2o_dev->device.parent = &c->device;
rc = device_register(&i2o_dev->device);
- if (rc)
+ if (rc) {
+ put_device(&i2o_dev->device);
goto err;
+ }
list_add_tail(&i2o_dev->list, &c->devices);
--
1.7.0.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-09-19 12:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-19 12:54 [PATCH 05/14] message: i2o: fix device_register() error handling Vasiliy Kulikov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox