diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2009-06-06 15:22:33 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-06 15:22:33 -0400 |
commit | e9fbc9dc9214d6a9de7d62627be5414804fd7b9f (patch) | |
tree | 296e7c7438bf7ef3b89a91ed79248b186e540d92 /tools/perf/util/symbol.c | |
parent | 39273ee9756917129de3190d469b0b120f87e763 (diff) |
perf_counter tools: Initialize a stack variable before use
the "perf report" utility crashed in some circumstances
because the "sym" stack variable was not initialized before used
(as also proven by valgrind).
With this fix both the crash goes away and valgrind no longer complains.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r-- | tools/perf/util/symbol.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 253821d1efdb..158588c7f6b1 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -457,6 +457,8 @@ static int dso__load_sym(struct dso *self, int fd, const char *name, | |||
457 | 457 | ||
458 | nr_syms = shdr.sh_size / shdr.sh_entsize; | 458 | nr_syms = shdr.sh_size / shdr.sh_entsize; |
459 | 459 | ||
460 | memset(&sym, 0, sizeof(sym)); | ||
461 | |||
460 | elf_symtab__for_each_symbol(syms, nr_syms, index, sym) { | 462 | elf_symtab__for_each_symbol(syms, nr_syms, index, sym) { |
461 | struct symbol *f; | 463 | struct symbol *f; |
462 | uint64_t obj_start; | 464 | uint64_t obj_start; |