summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2012-04-04 22:21:31 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-04-05 18:58:45 -0300
commit8493fe1daf15324eb13a4cc2f94e258716daa568 (patch)
tree31cdd2296154a6288b643cda10af61b78235f4a1 /tools
parent63fa471dd49e9c9ce029d910d1024330d9b1b145 (diff)
downloadlinux-3.10-8493fe1daf15324eb13a4cc2f94e258716daa568.tar.gz
linux-3.10-8493fe1daf15324eb13a4cc2f94e258716daa568.tar.bz2
linux-3.10-8493fe1daf15324eb13a4cc2f94e258716daa568.zip
perf hists browser: Fix NULL deref in hists browsing code
If there's an event with no samples in data file, the perf report command can segfault after entering the event details menu. Following steps reproduce the issue: # ./perf record -e syscalls:sys_enter_kexec_load,syscalls:sys_enter_mmap ls # ./perf report # enter '0 syscalls:sys_enter_kexec_load' menu # pres ENTER twice Above steps are valid assuming ls wont run kexec.. ;) The check for sellection to be NULL is missing. The fix makes sure it's being check. Above steps now endup with menu being displayed allowing 'Exit' as the only option. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1333570898-10505-2-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/ui/browsers/hists.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/util/ui/browsers/hists.c b/tools/perf/util/ui/browsers/hists.c
index d7a1c4afe28..2f83e5dc996 100644
--- a/tools/perf/util/ui/browsers/hists.c
+++ b/tools/perf/util/ui/browsers/hists.c
@@ -125,6 +125,9 @@ static int callchain__count_rows(struct rb_root *chain)
static bool map_symbol__toggle_fold(struct map_symbol *self)
{
+ if (!self)
+ return false;
+
if (!self->has_children)
return false;