提交 04342ad9 编写于 作者: T Tejun Heo 提交者: Yang Yingliang

blkcg: fix missing free on error path of blk_iocost_init()

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: NHillf Danton <hdanton@sina.com>
Signed-off-by: NTejun Heo <tj@kernel.org>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
Signed-off-by: NYu Kuai <yukuai3@huawei.com>
Reviewed-by: NHou Tao <houtao1@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 39ec6a90
...@@ -1877,6 +1877,7 @@ static int blk_iocost_init(struct request_queue *q) ...@@ -1877,6 +1877,7 @@ static int blk_iocost_init(struct request_queue *q)
ret = blkcg_activate_policy(q, &blkcg_policy_iocost); ret = blkcg_activate_policy(q, &blkcg_policy_iocost);
if (ret) { if (ret) {
rq_qos_del(q, rqos); rq_qos_del(q, rqos);
free_percpu(ioc->pcpu_stat);
kfree(ioc); kfree(ioc);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册