From: tip-bot for Samuel Liao <samuelliao@tencent.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, paulus@samba.org,
mingo@redhat.com, hpa@zytor.com, mingo@kernel.org,
davidshan@tencent.com, a.p.zijlstra@chello.nl,
namhyung.kim@lge.com, samuelliao@tencent.com, tglx@linutronix.de
Subject: [tip:perf/core] perf annotate: Check null of sym pointer before using it
Date: Wed, 20 Jun 2012 10:01:43 -0700 [thread overview]
Message-ID: <tip-c0a58fb2bdf033df433cad9009c7dac4c6b872b0@git.kernel.org> (raw)
In-Reply-To: <4FCD95D3.90209@gmail.com>
Commit-ID: c0a58fb2bdf033df433cad9009c7dac4c6b872b0
Gitweb: http://git.kernel.org/tip/c0a58fb2bdf033df433cad9009c7dac4c6b872b0
Author: Samuel Liao <samuelliao@tencent.com>
AuthorDate: Tue, 5 Jun 2012 13:14:59 +0800
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 19 Jun 2012 14:30:26 -0300
perf annotate: Check null of sym pointer before using it
Sym may be NULL, and that will cause perf to crash.
Signed-off-by: Shan Wei <davidshan@tencent.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/4FCD95D3.90209@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/ui/browsers/annotate.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 34b1c46..67a2703 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -814,7 +814,7 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx,
{
struct disasm_line *pos, *n;
struct annotation *notes;
- const size_t size = symbol__size(sym);
+ size_t size;
struct map_symbol ms = {
.map = map,
.sym = sym,
@@ -834,6 +834,8 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx,
if (sym == NULL)
return -1;
+ size = symbol__size(sym);
+
if (map->dso->annotate_warned)
return -1;
prev parent reply other threads:[~2012-06-20 17:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-05 5:14 [Perf bug-fix] check " Shan Wei
2012-06-11 2:07 ` Shan Wei
2012-06-11 4:45 ` Namhyung Kim
2012-06-20 17:01 ` tip-bot for Samuel Liao [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-c0a58fb2bdf033df433cad9009c7dac4c6b872b0@git.kernel.org \
--to=samuelliao@tencent.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=davidshan@tencent.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung.kim@lge.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
Powered by JetHome