[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <47B4F7F1.1090002@cn.fujitsu.com>
Date: Fri, 15 Feb 2008 10:24:49 +0800
From: Li Zefan <lizf@...fujitsu.com>
To: rdreier@...co.com
CC: sean.hefty@...el.com, hal.rosenstock@...il.com,
general@...ts.openfabrics.org, LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] fix return value in ib_device_register_sysfs()
Set ret to -ENOMEM when kobject_create_and_add() returns NULL.
Signed-off-by: Li Zefan <lizf@...fujitsu.com>
---
drivers/infiniband/core/sysfs.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
index c864ef7..5a4b2e6 100644
--- a/drivers/infiniband/core/sysfs.c
+++ b/drivers/infiniband/core/sysfs.c
@@ -686,8 +686,10 @@ int ib_device_register_sysfs(struct ib_device *device)
device->ports_parent = kobject_create_and_add("ports",
kobject_get(&class_dev->kobj));
- if (!device->ports_parent)
+ if (!device->ports_parent) {
+ ret = -ENOMEM;
goto err_put;
+ }
if (device->node_type == RDMA_NODE_IB_SWITCH) {
ret = add_port(device, 0);
--
1.5.4.rc3
--
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