All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Daniel Baluta <dbaluta@ixiacom.com>, Ingo Molnar <mingo@kernel.org>
Cc: a.p.zijlstra@chello.nl, paulus@samba.org, mingo@redhat.com,
	acme@ghostprotocols.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf/hwbp: Fix cleanup in case of kzalloc failure
Date: Wed, 6 Feb 2013 23:58:46 +0100	[thread overview]
Message-ID: <CAFTL4hy=hv_ey-_2gMKtW=pd7r+X6PP5cQ6_sHzsLUYqeFV5Tg@mail.gmail.com> (raw)
In-Reply-To: <1360186160-7566-1-git-send-email-dbaluta@ixiacom.com>

2013/2/6 Daniel Baluta <dbaluta@ixiacom.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@ixiacom.com>

Good catch!

Acked-by: Frederic Weisbecker <fweisbec@gmail.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
>

  reply	other threads:[~2013-02-06 22:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-06 21:29 [PATCH] perf/hwbp: Fix cleanup in case of kzalloc failure Daniel Baluta
2013-02-06 22:58 ` Frederic Weisbecker [this message]
2013-02-07 12:11 ` [tip:perf/urgent] perf/hwbp: Fix cleanup in case of kzalloc() failure tip-bot for Daniel Baluta
2013-02-15 16:40 ` [tip:perf/core] perf/hwbp: Fix cleanup in case of kzalloc failure tip-bot for Daniel Baluta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFTL4hy=hv_ey-_2gMKtW=pd7r+X6PP5cQ6_sHzsLUYqeFV5Tg@mail.gmail.com' \
    --to=fweisbec@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=dbaluta@ixiacom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.