提交 d791cf33 编写于 作者: H Hui Tang 提交者: zhangchangzhong

sched: Fix memory leak on error branch

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7EBNA
CVE: NA

-------------------------------

Fix memory leak on error branch for smart grid.

Fixes: 713cfd26 ("sched: Introduce smart grid scheduling strategy for cfs")
Signed-off-by: NHui Tang <tanghui20@huawei.com>
Reviewed-by: NZhang Qiao <zhangqiao22@huawei.com>
Signed-off-by: NZhang Changzhong <zhangchangzhong@huawei.com>
上级 b43a1c9e
......@@ -5628,7 +5628,6 @@ static int init_affinity_domains(struct affinity_domain *ad)
}
if (!sd) {
ad->dcount = 0;
rcu_read_unlock();
return -EINVAL;
}
......@@ -5636,8 +5635,10 @@ static int init_affinity_domains(struct affinity_domain *ad)
for (i = 0; i < dcount; i++) {
ad->domains[i] = kmalloc(sizeof(cpumask_t), GFP_KERNEL);
if (!ad->domains[i])
if (!ad->domains[i]) {
ad->dcount = i;
goto err;
}
}
rcu_read_lock();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册