lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 28 Nov 2017 22:28:57 -0800
From:   tip-bot for Andrei Vagin <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     hpa@...or.com, acme@...hat.com, namhyung@...nel.org,
        mingo@...nel.org, peterz@...radead.org, tglx@...utronix.de,
        avagin@...nvz.org, jolsa@...hat.com,
        alexander.shishkin@...ux.intel.com, vvs@...tuozzo.com,
        linux-kernel@...r.kernel.org
Subject: [tip:perf/core] perf trace: Fix an exit code of trace__symbols_init

Commit-ID:  35c33633abc14b906e84b7b0115ede6df6830120
Gitweb:     https://git.kernel.org/tip/35c33633abc14b906e84b7b0115ede6df6830120
Author:     Andrei Vagin <avagin@...nvz.org>
AuthorDate: Tue, 7 Nov 2017 16:22:46 -0800
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Tue, 28 Nov 2017 14:20:15 -0300

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@...nvz.org>
Reviewed-by: Jiri Olsa <jolsa@...hat.com>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Vasily Averin <vvs@...tuozzo.com>
Link: http://lkml.kernel.org/r/20171108002246.8924-2-avagin@openvz.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/builtin-trace.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index f2757d3..84debdb 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();
 

Powered by blists - more mailing lists