[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170824162737.7813-8-jolsa@kernel.org>
Date: Thu, 24 Aug 2017 18:27:34 +0200
From: Jiri Olsa <jolsa@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: lkml <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Namhyung Kim <namhyung@...nel.org>,
David Ahern <dsahern@...il.com>,
Andi Kleen <andi@...stfloor.org>,
Mark Rutland <mark.rutland@....com>
Subject: [PATCH 07/10] perf values: Fix allocation check
Bailing out in case the allocation failed,
not the other way round.
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
---
tools/perf/util/values.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/values.c b/tools/perf/util/values.c
index 9ac36bf2c438..2c4af02f08cd 100644
--- a/tools/perf/util/values.c
+++ b/tools/perf/util/values.c
@@ -131,7 +131,7 @@ static int perf_read_values__enlarge_counters(struct perf_read_values *values)
for (i = 0; i < values->threads; i++) {
u64 *value = realloc(values->value[i], counters_max * sizeof(**values->value));
- if (value) {
+ if (!value) {
pr_debug("failed to enlarge read_values ->values array");
goto out_free_name;
}
--
2.9.5
Powered by blists - more mailing lists