Skip to content

Commit

Permalink
RDMA: Add error handling to ib_core_init()
Browse files Browse the repository at this point in the history
Fail RDMA midlayer initialization if sysfs setup fails.

Signed-off-by: Nir Muchtar <nirm@voltaire.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
  • Loading branch information
Nir Muchtar authored and Roland Dreier committed May 20, 2011
1 parent 257313b commit fd75c78
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions drivers/infiniband/core/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit fd75c78

Please sign in to comment.