Re: [PATCH] sched: fix double kfree

From: Li Zefan
Date: Tue Jan 06 2009 - 20:20:33 EST


> Another thing I noticed but didn't deal with is:
>
> static int init_rootdomain(struct root_domain *rd, bool bootmem)
> {
> memset(rd, 0, sizeof(*rd));
>
> if (bootmem) {
> alloc_bootmem_cpumask_var(&def_root_domain.span);
> alloc_bootmem_cpumask_var(&def_root_domain.online);
> alloc_bootmem_cpumask_var(&def_root_domain.rto_mask);
> cpupri_init(&rd->cpupri, true);
> return 0;
> }
> if (!alloc_cpumask_var(&rd->span, GFP_KERNEL))
> ...
>
> Note that under the if (bootmem) case, it specifies the addresses
> directly instead of using (&rd->span) as the other alloc's do.
>
> Not a big deal, just an inconsistency.
>

I didn't notice this. :)

What makes it a bit worse is another inconsistency in if(bootmem), that rd
is used in cpupri_init() but def_root_domain is used in alloc()s.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/