public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Namhyung Kim <namhyung.kim@lge.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, paulus@samba.org, hpa@zytor.com,
	mingo@redhat.com, a.p.zijlstra@chello.nl,
	acme@ghostprotocols.net, namhyung.kim@lge.com,
	namhyung@gmail.com, fweisbec@gmail.com, tglx@linutronix.de,
	mingo@elte.hu
Subject: [tip:perf/urgent] perf: Don't call release_callchain_buffers() if allocation fails
Date: Sun, 22 Jan 2012 13:07:22 -0800	[thread overview]
Message-ID: <tip-fd45c15f13e754f3c106427e857310f3e0813951@git.kernel.org> (raw)
In-Reply-To: <1327021966-27688-1-git-send-email-namhyung.kim@lge.com>

Commit-ID:  fd45c15f13e754f3c106427e857310f3e0813951
Gitweb:     http://git.kernel.org/tip/fd45c15f13e754f3c106427e857310f3e0813951
Author:     Namhyung Kim <namhyung.kim@lge.com>
AuthorDate: Fri, 20 Jan 2012 10:12:45 +0900
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Sat, 21 Jan 2012 09:33:41 +0100

perf: Don't call release_callchain_buffers() if allocation fails

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>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Link: http://lkml.kernel.org/r/1327021966-27688-1-git-send-email-namhyung.kim@lge.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 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 057e24b..6581a04 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);
 

      parent reply	other threads:[~2012-01-22 21:08 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 ` [PATCH 1/2] perf: Don't call release_callchain_buffers if alloc fails Frederic Weisbecker
2012-01-22 21:07 ` tip-bot for Namhyung Kim [this message]

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=tip-fd45c15f13e754f3c106427e857310f3e0813951@git.kernel.org \
    --to=namhyung.kim@lge.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=namhyung@gmail.com \
    --cc=paulus@samba.org \
    --cc=tglx@linutronix.de \
    /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