public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Namhyung Kim <namhyung.kim@lge.com>
Cc: Ingo Molnar <mingo@elte.hu>, Namhyung Kim <namhyung@gmail.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>,
	Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] perf: Don't call release_callchain_buffers if alloc fails
Date: Fri, 20 Jan 2012 04:59:13 +0100	[thread overview]
Message-ID: <20120120035910.GB18056@somewhere> (raw)
In-Reply-To: <1327021966-27688-1-git-send-email-namhyung.kim@lge.com>

On Fri, Jan 20, 2012 at 10:12:45AM +0900, Namhyung Kim wrote:
> When alloc_callchain_buffers() fails, it frees all of
> entries before return. In addition, calling the
> release_callchain_buffers() will cause a NULL pointer
> dereference since callchain_cpu_entries is not set.
> 
> Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>

Acked-by: Frederic Weisbecker <fweisbec@gmail.com>

> ---
>  kernel/events/callchain.c |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/events/callchain.c b/kernel/events/callchain.c
> index 057e24b665cf..6581a040f399 100644
> --- a/kernel/events/callchain.c
> +++ b/kernel/events/callchain.c
> @@ -115,8 +115,6 @@ int get_callchain_buffers(void)
>  	}
>  
>  	err = alloc_callchain_buffers();
> -	if (err)
> -		release_callchain_buffers();
>  exit:
>  	mutex_unlock(&callchain_mutex);
>  
> -- 
> 1.7.9.rc1.dirty
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

  parent reply	other threads:[~2012-01-20  3:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-20  1:12 [PATCH 1/2] perf: Don't call release_callchain_buffers if alloc fails Namhyung Kim
2012-01-20  1:12 ` [PATCH 2/2] perf: Call perf_cgroup_event_time directly Namhyung Kim
2012-01-22 21:08   ` [tip:perf/urgent] perf: Call perf_cgroup_event_time() directly tip-bot for Namhyung Kim
2012-01-20  3:59 ` Frederic Weisbecker [this message]
2012-01-22 21:07 ` [tip:perf/urgent] perf: Don't call release_callchain_buffers() if allocation fails tip-bot for Namhyung Kim

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=20120120035910.GB18056@somewhere \
    --to=fweisbec@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=namhyung.kim@lge.com \
    --cc=namhyung@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox