diff options
author | Andrei Vagin <avagin@openvz.org> | 2017-11-07 16:22:46 -0800 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-11-28 14:20:15 -0300 |
commit | 35c33633abc14b906e84b7b0115ede6df6830120 (patch) | |
tree | cca5396dfdb3b3d370f2ce74392305b7d569bc17 | |
parent | 59622fd496a3175c7bf549046e091d81c303ecff (diff) | |
download | linux-stable-35c33633abc14b906e84b7b0115ede6df6830120.tar.gz linux-stable-35c33633abc14b906e84b7b0115ede6df6830120.tar.bz2 linux-stable-35c33633abc14b906e84b7b0115ede6df6830120.zip |
perf trace: Fix an exit code of trace__symbols_init
Currently if trace_event__register_resolver() fails, we return -errno,
but we can't be sure that errno isn't zero in this case.
Signed-off-by: Andrei Vagin <avagin@openvz.org>
Reviewed-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Vasily Averin <vvs@virtuozzo.com>
Link: http://lkml.kernel.org/r/20171108002246.8924-2-avagin@openvz.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/builtin-trace.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index f2757d38c7d7..84debdbad327 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -1152,12 +1152,14 @@ static int trace__symbols_init(struct trace *trace, struct perf_evlist *evlist) if (trace->host == NULL) return -ENOMEM; - if (trace_event__register_resolver(trace->host, trace__machine__resolve_kernel_addr) < 0) - return -errno; + err = trace_event__register_resolver(trace->host, trace__machine__resolve_kernel_addr); + if (err < 0) + goto out; err = __machine__synthesize_threads(trace->host, &trace->tool, &trace->opts.target, evlist->threads, trace__tool_process, false, trace->opts.proc_map_timeout, 1); +out: if (err) symbol__exit(); |