lkml.org 
[lkml]   [2010]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 05/14] message: i2o: fix device_register() error handling
Date
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


\
 
 \ /
  Last update: 2010-09-19 14:59    [W:0.027 / U:0.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site