All of lore.kernel.org
 help / color / mirror / Atom feed
* [tip: perf/urgent] perf annotate: Return appropriate error code for allocation failures
       [not found] <tip-8of1cmj3rz0mppfcshc9bbqq@git.kernel.org>
@ 2019-10-07 14:49 ` tip-bot2 for Arnaldo Carvalho de Melo
  0 siblings, 0 replies; only message in thread
From: tip-bot2 for Arnaldo Carvalho de Melo @ 2019-10-07 14:49 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Russell King - ARM Linux admin, Adrian Hunter,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim, Peter Zijlstra,
	Will Deacon, Arnaldo Carvalho de Melo, Ingo Molnar,
	Borislav Petkov, linux-kernel

The following commit has been merged into the perf/urgent branch of tip:

Commit-ID:     16ed3c1e91159e28b02f11f71ff4ce4cbc6f99e4
Gitweb:        https://git.kernel.org/tip/16ed3c1e91159e28b02f11f71ff4ce4cbc6f99e4
Author:        Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate:    Mon, 30 Sep 2019 15:53:33 -03:00
Committer:     Arnaldo Carvalho de Melo <acme@redhat.com>
CommitterDate: Mon, 30 Sep 2019 17:30:04 -03:00

perf annotate: Return appropriate error code for allocation failures

We should return errno or the annotation extra range understood by
symbol__strerror_disassemble() instead of -1, fix it, returning ENOMEM
instead.

Reported-by: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
Cc: Will Deacon <will@kernel.org>
Link: https://lkml.kernel.org/n/tip-8of1cmj3rz0mppfcshc9bbqq@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/annotate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index dc15352..b49ecdd 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -1668,7 +1668,7 @@ static int dso__disassemble_filename(struct dso *dso, char *filename, size_t fil
 
 	build_id_path = strdup(filename);
 	if (!build_id_path)
-		return -1;
+		return ENOMEM;
 
 	/*
 	 * old style build-id cache has name of XX/XXXXXXX.. while
@@ -2977,7 +2977,7 @@ int symbol__annotate2(struct symbol *sym, struct map *map, struct evsel *evsel,
 
 	notes->offsets = zalloc(size * sizeof(struct annotation_line *));
 	if (notes->offsets == NULL)
-		return -1;
+		return ENOMEM;
 
 	if (perf_evsel__is_group_event(evsel))
 		nr_pcnt = evsel->core.nr_members;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-10-07 14:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <tip-8of1cmj3rz0mppfcshc9bbqq@git.kernel.org>
2019-10-07 14:49 ` [tip: perf/urgent] perf annotate: Return appropriate error code for allocation failures tip-bot2 for Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.