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>
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;