Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b045bd1 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Jens Axboe
Browse files

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: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fixes: 52ebea74 ("writeback: make backing_dev_info host cgroup-specific bdi_writebacks")
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 09c2c359
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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)