Skip to content

Commit

Permalink
rbd: fix error return code in rbd_dev_device_setup()
Browse files Browse the repository at this point in the history
Fix to return -ENOMEM from the workqueue alloc error handling
case instead of 0, as done elsewhere in this function.

Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
  • Loading branch information
Wei Yongjun authored and Ilya Dryomov committed Sep 10, 2014
1 parent 58d1362 commit 255939e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 255939e

Please sign in to comment.