bdi: fix wrong error return value in cgwb_create()

On wb_congested_get_create() failure, cgwb_create() forgot to set @ret
to -ENOMEM ending up returning 0.  Fix it so that it returns -ENOMEM.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
Tejun Heo 2015-06-05 06:20:51 +09:00 committed by Jens Axboe
parent d2e73fcceb
commit 5857cd637b
1 changed files with 3 additions and 1 deletions

View File

@ -554,8 +554,10 @@ static int cgwb_create(struct backing_dev_info *bdi,
goto err_ref_exit;
wb->congested = wb_congested_get_create(bdi, blkcg_css->id, gfp);
if (!wb->congested)
if (!wb->congested) {
ret = -ENOMEM;
goto err_fprop_exit;
}
wb->memcg_css = memcg_css;
wb->blkcg_css = blkcg_css;