summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2017-09-11 15:43:23 -0400
committerJens Axboe <axboe@kernel.dk>2017-09-11 16:16:44 -0400
commit0b045bd1c1c2819b33f4522e3efa4666d1ecf1a4 (patch)
tree33fb862c96efa57895b6a67980f8e27c0c24363b /mm
parent09c2c359be546df45be0b158ea1d3cc8ea83c876 (diff)
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 <christophe.jaillet@wanadoo.fr> Fixes: 52ebea749aae ("writeback: make backing_dev_info host cgroup-specific bdi_writebacks") Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'mm')
-rw-r--r--mm/backing-dev.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index f028a9a472fd..e19606bb41a0 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -569,8 +569,10 @@ static int cgwb_create(struct backing_dev_info *bdi,
569 569
570 /* need to create a new one */ 570 /* need to create a new one */
571 wb = kmalloc(sizeof(*wb), gfp); 571 wb = kmalloc(sizeof(*wb), gfp);
572 if (!wb) 572 if (!wb) {
573 return -ENOMEM; 573 ret = -ENOMEM;
574 goto out_put;
575 }
574 576
575 ret = wb_init(wb, bdi, blkcg_css->id, gfp); 577 ret = wb_init(wb, bdi, blkcg_css->id, gfp);
576 if (ret) 578 if (ret)