[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <84144f020901060150i524a4fatdc1c2ca86ab2adab@mail.gmail.com>
Date: Tue, 6 Jan 2009 11:50:56 +0200
From: "Pekka Enberg" <penberg@...helsinki.fi>
To: "Li Zefan" <lizf@...fujitsu.com>
Cc: "Ingo Molnar" <mingo@...e.hu>,
"Rusty Russell" <rusty@...tcorp.com.au>,
"Peter Zijlstra" <a.p.zijlstra@...llo.nl>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] sched: fix double kfree
On Tue, Jan 6, 2009 at 11:39 AM, Li Zefan <lizf@...fujitsu.com> wrote:
> Impact: 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@...fujitsu.com>
FWIW
Reviewed-by: Pekka Enberg <penberg@...helsinki.fi>
> ---
> kernel/sched.c | 5 ++---
> 1 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/sched.c b/kernel/sched.c
> index 545c6fc..2bad712 100644
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -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;
> }
>
> --
> 1.5.4.rc3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists