提交 0b045bd1 编写于 作者: C Christophe JAILLET 提交者: Jens Axboe

mm/backing-dev.c: fix an error handling path in 'cgwb_create()'

If the 'kmalloc' fails, we must go through the existing error handling
path.
Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fixes: 52ebea74 ("writeback: make backing_dev_info host cgroup-specific bdi_writebacks")
Reviewed-by: NJan Kara <jack@suse.cz>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 09c2c359
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册