[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1284900893-24411-1-git-send-email-segooon@gmail.com>
Date: Sun, 19 Sep 2010 16:54:52 +0400
From: Vasiliy Kulikov <segooon@...il.com>
To: kernel-janitors@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH 05/14] message: i2o: 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/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
--
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