From 3532e7227243beb0b782266dc05c40b6184ad051 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Thu, 29 Aug 2019 08:53:06 -0700 Subject: [PATCH] blkcg: fix missing free on error path of blk_iocost_init() blk_iocost_init() forgot to free its percpu stat on the error path. Fix it. Fixes: 7caa47151ab2 ("blkcg: implement blk-iocost") Reported-by: Hillf Danton Signed-off-by: Tejun Heo Signed-off-by: Jens Axboe --- block/blk-iocost.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/blk-iocost.c b/block/blk-iocost.c index f04a4ed..9c8046a 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -1876,6 +1876,7 @@ static int blk_iocost_init(struct request_queue *q) ret = blkcg_activate_policy(q, &blkcg_policy_iocost); if (ret) { rq_qos_del(q, rqos); + free_percpu(ioc->pcpu_stat); kfree(ioc); return ret; } -- 2.7.4