From: Jiri Olsa Date: Thu, 24 Aug 2017 16:27:34 +0000 (+0200) Subject: perf values: Fix allocation check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f4ef3b7c184c4c269f953f226f7158347d007622;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git perf values: Fix allocation check Bailing out in case the allocation failed, not the other way round. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: David Ahern Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20170824162737.7813-8-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- 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; }