mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
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: Li Zefan <lizf@cn.fujitsu.com> Reviewed-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
d9be28ea91
commit
0c910d2895
1 changed files with 2 additions and 3 deletions
|
@ -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 @@ free_online:
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue