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

Commit 255939e7 authored by Wei Yongjun's avatar Wei Yongjun Committed by Ilya Dryomov
Browse files

rbd: fix error return code in rbd_dev_device_setup()



Fix to return -ENOMEM from the workqueue alloc error handling
case instead of 0, as done elsewhere in this function.

Reviewed-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
parent 58d1362b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -5088,8 +5088,10 @@ static int rbd_dev_device_setup(struct rbd_device *rbd_dev)
	set_disk_ro(rbd_dev->disk, rbd_dev->mapping.read_only);

	rbd_dev->rq_wq = alloc_workqueue("%s", 0, 0, rbd_dev->disk->disk_name);
	if (!rbd_dev->rq_wq)
	if (!rbd_dev->rq_wq) {
		ret = -ENOMEM;
		goto err_out_mapping;
	}

	ret = rbd_bus_add_dev(rbd_dev);
	if (ret)