Skip to content

Commit

Permalink
bdi: fix wrong error return value in cgwb_create()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
htejun authored and axboe committed Jun 4, 2015
1 parent d2e73fc commit 5857cd6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mm/backing-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5857cd6

Please sign in to comment.