From: Christophe JAILLET Date: Mon, 11 Sep 2017 19:43:23 +0000 (+0200) Subject: mm/backing-dev.c: fix an error handling path in 'cgwb_create()' X-Git-Tag: v4.14-rc1~42^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b045bd1c1c2819b33f4522e3efa4666d1ecf1a4;p=platform%2Fkernel%2Flinux-exynos.git 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: Christophe JAILLET Fixes: 52ebea749aae ("writeback: make backing_dev_info host cgroup-specific bdi_writebacks") Reviewed-by: Jan Kara Signed-off-by: Jens Axboe --- diff --git a/mm/backing-dev.c b/mm/backing-dev.c index f028a9a..e19606b 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -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)