From: Tejun Heo tj@kernel.org
mainline inclusion from mainline-5.4-rc1 commit 3532e7227243beb0b782266dc05c40b6184ad051 category: feature bugzilla: 38688 CVE: NA
---------------------------
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 hdanton@sina.com Signed-off-by: Tejun Heo tj@kernel.org Signed-off-by: Jens Axboe axboe@kernel.dk Signed-off-by: Yu Kuai yukuai3@huawei.com Reviewed-by: Hou Tao houtao1@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- block/blk-iocost.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/block/blk-iocost.c b/block/blk-iocost.c index fd06a7077635d..b542f6581814e 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -1877,6 +1877,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; }