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>
This commit is contained in:
parent
257313b2a8
commit
fd75c789ab
@ -725,16 +725,24 @@ static int __init ib_core_init(void)
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
ret = ib_sysfs_setup();
|
ret = ib_sysfs_setup();
|
||||||
if (ret)
|
if (ret) {
|
||||||
printk(KERN_WARNING "Couldn't create InfiniBand device class\n");
|
printk(KERN_WARNING "Couldn't create InfiniBand device class\n");
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
ret = ib_cache_setup();
|
ret = ib_cache_setup();
|
||||||
if (ret) {
|
if (ret) {
|
||||||
printk(KERN_WARNING "Couldn't set up InfiniBand P_Key/GID cache\n");
|
printk(KERN_WARNING "Couldn't set up InfiniBand P_Key/GID cache\n");
|
||||||
ib_sysfs_cleanup();
|
goto err_sysfs;
|
||||||
destroy_workqueue(ib_wq);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
err_sysfs:
|
||||||
|
ib_sysfs_cleanup();
|
||||||
|
|
||||||
|
err:
|
||||||
|
destroy_workqueue(ib_wq);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user