Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd75c789 authored by Nir Muchtar's avatar Nir Muchtar Committed by Roland Dreier
Browse files

RDMA: Add error handling to ib_core_init()



Fail RDMA midlayer initialization if sysfs setup fails.

Signed-off-by: default avatarNir Muchtar <nirm@voltaire.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 257313b2
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -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;
}