aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2009-01-06 04:39:06 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-06 05:07:04 -0500
commit0c910d289567163dbe40ccc174b36afd1c7723bd (patch)
tree9458ac750e2f174936d7e0704d25548c110e0fa0 /kernel/sched.c
parentd9be28ea9110c596a05bd2d56afa94251bd19818 (diff)
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>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index c5019a5dcaa4..973f97362ceb 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6970,7 +6970,7 @@ static int init_rootdomain(struct root_domain *rd, bool bootmem)
6970 } 6970 }
6971 6971
6972 if (!alloc_cpumask_var(&rd->span, GFP_KERNEL)) 6972 if (!alloc_cpumask_var(&rd->span, GFP_KERNEL))
6973 goto free_rd; 6973 goto out;
6974 if (!alloc_cpumask_var(&rd->online, GFP_KERNEL)) 6974 if (!alloc_cpumask_var(&rd->online, GFP_KERNEL))
6975 goto free_span; 6975 goto free_span;
6976 if (!alloc_cpumask_var(&rd->rto_mask, GFP_KERNEL)) 6976 if (!alloc_cpumask_var(&rd->rto_mask, GFP_KERNEL))
@@ -6986,8 +6986,7 @@ free_online:
6986 free_cpumask_var(rd->online); 6986 free_cpumask_var(rd->online);
6987free_span: 6987free_span:
6988 free_cpumask_var(rd->span); 6988 free_cpumask_var(rd->span);
6989free_rd: 6989out:
6990 kfree(rd);
6991 return -ENOMEM; 6990 return -ENOMEM;
6992} 6991}
6993 6992