[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFTL4hy=hv_ey-_2gMKtW=pd7r+X6PP5cQ6_sHzsLUYqeFV5Tg@mail.gmail.com>
Date: Wed, 6 Feb 2013 23:58:46 +0100
From: Frederic Weisbecker <fweisbec@...il.com>
To: Daniel Baluta <dbaluta@...acom.com>, Ingo Molnar <mingo@...nel.org>
Cc: a.p.zijlstra@...llo.nl, paulus@...ba.org, mingo@...hat.com,
acme@...stprotocols.net, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf/hwbp: Fix cleanup in case of kzalloc failure
2013/2/6 Daniel Baluta <dbaluta@...acom.com>:
> Obviously this is a typo and could result in memory leaks
> if kzalloc fails on a given cpu.
>
> Signed-off-by: Daniel Baluta <dbaluta@...acom.com>
Good catch!
Acked-by: Frederic Weisbecker <fweisbec@...il.com>
> ---
> kernel/events/hw_breakpoint.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/events/hw_breakpoint.c b/kernel/events/hw_breakpoint.c
> index fe8a916..a64f8ae 100644
> --- a/kernel/events/hw_breakpoint.c
> +++ b/kernel/events/hw_breakpoint.c
> @@ -676,7 +676,7 @@ int __init init_hw_breakpoint(void)
> err_alloc:
> for_each_possible_cpu(err_cpu) {
> for (i = 0; i < TYPE_MAX; i++)
> - kfree(per_cpu(nr_task_bp_pinned[i], cpu));
> + kfree(per_cpu(nr_task_bp_pinned[i], err_cpu));
> if (err_cpu == cpu)
> break;
> }
> --
> 1.7.5.4
>
--
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