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

sched: fix double kfree in failure path

It's not the responsibility of init_rootdomain() to free root_domain
allocated by alloc_rootdomain().
Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
Reviewed-by: NPekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 d9be28ea
...@@ -6970,7 +6970,7 @@ static int init_rootdomain(struct root_domain *rd, bool bootmem) ...@@ -6970,7 +6970,7 @@ static int init_rootdomain(struct root_domain *rd, bool bootmem)
} }
if (!alloc_cpumask_var(&rd->span, GFP_KERNEL)) if (!alloc_cpumask_var(&rd->span, GFP_KERNEL))
goto free_rd; goto out;
if (!alloc_cpumask_var(&rd->online, GFP_KERNEL)) if (!alloc_cpumask_var(&rd->online, GFP_KERNEL))
goto free_span; goto free_span;
if (!alloc_cpumask_var(&rd->rto_mask, GFP_KERNEL)) if (!alloc_cpumask_var(&rd->rto_mask, GFP_KERNEL))
...@@ -6986,8 +6986,7 @@ static int init_rootdomain(struct root_domain *rd, bool bootmem) ...@@ -6986,8 +6986,7 @@ static int init_rootdomain(struct root_domain *rd, bool bootmem)
free_cpumask_var(rd->online); free_cpumask_var(rd->online);
free_span: free_span:
free_cpumask_var(rd->span); free_cpumask_var(rd->span);
free_rd: out:
kfree(rd);
return -ENOMEM; return -ENOMEM;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册