]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
sched: fix double kfree in failure path
authorLi Zefan <lizf@cn.fujitsu.com>
Tue, 6 Jan 2009 09:39:06 +0000 (17:39 +0800)
committerIngo Molnar <mingo@elte.hu>
Tue, 6 Jan 2009 10:07:04 +0000 (11:07 +0100)
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>
kernel/sched.c

index c5019a5dcaa44b00ee33b2567d16881a94c55107..973f97362ceb60be2d5c5e3a5ef5ef5eb0fb129f 100644 (file)
@@ -6970,7 +6970,7 @@ static int init_rootdomain(struct root_domain *rd, bool bootmem)
        }
 
        if (!alloc_cpumask_var(&rd->span, GFP_KERNEL))
-               goto free_rd;
+               goto out;
        if (!alloc_cpumask_var(&rd->online, GFP_KERNEL))
                goto free_span;
        if (!alloc_cpumask_var(&rd->rto_mask, GFP_KERNEL))
@@ -6986,8 +6986,7 @@ free_online:
        free_cpumask_var(rd->online);
 free_span:
        free_cpumask_var(rd->span);
-free_rd:
-       kfree(rd);
+out:
        return -ENOMEM;
 }