Skip to content

Commit

Permalink
mm/backing-dev.c: fix an error handling path in 'cgwb_create()'
Browse files Browse the repository at this point in the history
If the 'kmalloc' fails, we must go through the existing error handling
path.

Signed-off-by: Christophe JAILLET <[email protected]>
Fixes: 52ebea7 ("writeback: make backing_dev_info host cgroup-specific bdi_writebacks")
Reviewed-by: Jan Kara <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
tititiou36 authored and axboe committed Sep 11, 2017
1 parent 09c2c35 commit 0b045bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mm/backing-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,10 @@ static int cgwb_create(struct backing_dev_info *bdi,

/* need to create a new one */
wb = kmalloc(sizeof(*wb), gfp);
if (!wb)
return -ENOMEM;
if (!wb) {
ret = -ENOMEM;
goto out_put;
}

ret = wb_init(wb, bdi, blkcg_css->id, gfp);
if (ret)
Expand Down

0 comments on commit 0b045bd

Please sign in to comment.