This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH -tip 1/7] [BUGFIX] perf probe: Fix to close dwarf when failing to analyze it
- From: Masami Hiramatsu <mhiramat at redhat dot com>
- To: Ingo Molnar <mingo at elte dot hu>, lkml<linux-kernel at vger dot kernel dot org>
- Cc: systemtap<systemtap at sources dot redhat dot com>, DLE<dle-develop at lists dot sourceforge dot net>, Masami Hiramatsu <mhiramat at redhat dot com>, Ingo Molnar <mingo at elte dot hu>, Paul Mackerras <paulus at samba dot org>, Arnaldo Carvalho de Melo <acme at redhat dot com>, Peter Zijlstra <peterz at infradead dot org>, Mike Galbraith <efault at gmx dot de>, Frederic Weisbecker <fweisbec at gmail dot com>
- Date: Mon, 29 Mar 2010 16:37:45 -0400
- Subject: [PATCH -tip 1/7] [BUGFIX] perf probe: Fix to close dwarf when failing to analyze it
- References: <20100329203736.2577.56018.stgit@localhost6.localdomain6>
Fix to close libdw routine when failing to analyze it in
find_perf_probe_point().
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
---
tools/perf/util/probe-finder.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index db52ec2..5f6cecc 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -812,8 +812,10 @@ int find_perf_probe_point(int fd, unsigned long addr,
return -ENOENT;
/* Find cu die */
- if (!dwarf_addrdie(dbg, (Dwarf_Addr)addr, &cudie))
- return -EINVAL;
+ if (!dwarf_addrdie(dbg, (Dwarf_Addr)addr, &cudie)) {
+ ret = -EINVAL;
+ goto end;
+ }
/* Find a corresponding line */
line = dwarf_getsrc_die(&cudie, (Dwarf_Addr)addr);
--
Masami Hiramatsu
e-mail: mhiramat@redhat.com