From: Namhyung Kim <namhyung@kernel.org>
To: Shan Wei <shanwei88@gmail.com>
Cc: a.p.zijlstra@chello.nl, paulus@samba.org, mingo@redhat.com,
acme@ghostprotocols.net, namhyung.kim@lge.com,
Kernel-Maillist <linux-kernel@vger.kernel.org>,
Samuel Liao <samuelliao@tencent.com>
Subject: Re: [Perf bug-fix] check null of sym pointer before using it
Date: Mon, 11 Jun 2012 13:45:17 +0900 [thread overview]
Message-ID: <87y5nupici.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <4FD552CE.5020303@gmail.com> (Shan Wei's message of "Mon, 11 Jun 2012 10:07:10 +0800")
Hi,
On Mon, 11 Jun 2012 10:07:10 +0800, Shan Wei wrote:
> ping.....
>
> It's a obvious function bug.....
>
> Shan Wei said, at 2012/6/5 13:14:
>
>> From: Samuel Liao <samuelliao@tencent.com>
>>
>> Sometimes, sym will be null that causing perf crash.
>>
>> Signed-off-by: Shan Wei <davidshan@tencent.com>
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Thanks for the fix.
Namhyung
>> ---
>> 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 4deea6a..50873a8 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;
>>
next prev parent reply other threads:[~2012-06-11 4:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-05 5:14 Shan Wei
2012-06-11 2:07 ` Shan Wei
2012-06-11 4:45 ` Namhyung Kim [this message]
2012-06-20 17:01 ` [tip:perf/core] perf annotate: Check " tip-bot for Samuel Liao
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=87y5nupici.fsf@sejong.aot.lge.com \
--to=namhyung@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung.kim@lge.com \
--cc=paulus@samba.org \
--cc=samuelliao@tencent.com \
--cc=shanwei88@gmail.com \
/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
all inboxes | Powered by JetHome®