Commit 0a62c31b authored by Wei Yongjun's avatar Wei Yongjun Committed by Luis Henriques

rbd: fix error return code in rbd_dev_device_setup()

commit 255939e7 upstream.

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>
Cc: Ilya Dryomov <ilya.dryomov@inktank.com>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 9009238b
...@@ -5104,8 +5104,10 @@ static int rbd_dev_device_setup(struct rbd_device *rbd_dev) ...@@ -5104,8 +5104,10 @@ static int rbd_dev_device_setup(struct rbd_device *rbd_dev)
set_disk_ro(rbd_dev->disk, rbd_dev->mapping.read_only); 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); 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; goto err_out_mapping;
}
ret = rbd_bus_add_dev(rbd_dev); ret = rbd_bus_add_dev(rbd_dev);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment