summaryrefslogtreecommitdiff
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorNir Muchtar <nirm@voltaire.com>2011-05-20 11:46:10 -0700
committerRoland Dreier <roland@purestorage.com>2011-05-20 11:46:10 -0700
commitfd75c789abf7948e16fe50917a6acb809927719a (patch)
treee85ee47f2a5575e2f4f9398da43d9ca82fc275f9 /drivers/infiniband
parent257313b2a87795e07a0bdf58d0fffbdba8b31051 (diff)
downloadlinux-3.10-fd75c789abf7948e16fe50917a6acb809927719a.tar.gz
linux-3.10-fd75c789abf7948e16fe50917a6acb809927719a.tar.bz2
linux-3.10-fd75c789abf7948e16fe50917a6acb809927719a.zip
RDMA: Add error handling to ib_core_init()
Fail RDMA midlayer initialization if sysfs setup fails. Signed-off-by: Nir Muchtar <nirm@voltaire.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/core/device.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index f793bf2f5da..46a7a3febc1 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -725,16 +725,24 @@ static int __init ib_core_init(void)
return -ENOMEM;
ret = ib_sysfs_setup();
- if (ret)
+ if (ret) {
printk(KERN_WARNING "Couldn't create InfiniBand device class\n");
+ goto err;
+ }
ret = ib_cache_setup();
if (ret) {
printk(KERN_WARNING "Couldn't set up InfiniBand P_Key/GID cache\n");
- ib_sysfs_cleanup();
- destroy_workqueue(ib_wq);
+ goto err_sysfs;
}
+ return 0;
+
+err_sysfs:
+ ib_sysfs_cleanup();
+
+err:
+ destroy_workqueue(ib_wq);
return ret;
}