提交 faa2f98f 编写于 作者: L Li Zefan 提交者: Ingo Molnar

sched: add sanity check in partition_sched_domains()

Impact: cleanup, add debug check

It's wrong to make dattr_new = NULL if doms_new == NULL, it introduces
memory leak if dattr_new != NULL. Fortunately dattr_new is always NULL
in this case. So remove the code and add a sanity check.
Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
Acked-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 a17e2260
......@@ -7767,7 +7767,7 @@ void partition_sched_domains(int ndoms_new, cpumask_t *doms_new,
ndoms_cur = 0;
doms_new = &fallback_doms;
cpus_andnot(doms_new[0], cpu_online_map, cpu_isolated_map);
dattr_new = NULL;
WARN_ON_ONCE(dattr_new);
}
/* Build new domains */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册