From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751996AbdH2VXy (ORCPT ); Tue, 29 Aug 2017 17:23:54 -0400 Received: from terminus.zytor.com ([65.50.211.136]:46115 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751512AbdH2VXw (ORCPT ); Tue, 29 Aug 2017 17:23:52 -0400 Date: Tue, 29 Aug 2017 14:21:33 -0700 From: tip-bot for Jiri Olsa Message-ID: Cc: a.p.zijlstra@chello.nl, andi@firstfloor.org, alexander.shishkin@linux.intel.com, dsahern@gmail.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, hpa@zytor.com, jolsa@kernel.org, tglx@linutronix.de, namhyung@kernel.org, mingo@kernel.org, acme@redhat.com Reply-To: andi@firstfloor.org, a.p.zijlstra@chello.nl, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, dsahern@gmail.com, linux-kernel@vger.kernel.org, hpa@zytor.com, tglx@linutronix.de, namhyung@kernel.org, jolsa@kernel.org, acme@redhat.com, mingo@kernel.org In-Reply-To: <20170824162737.7813-8-jolsa@kernel.org> References: <20170824162737.7813-8-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf values: Fix allocation check Git-Commit-ID: f4ef3b7c184c4c269f953f226f7158347d007622 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: f4ef3b7c184c4c269f953f226f7158347d007622 Gitweb: http://git.kernel.org/tip/f4ef3b7c184c4c269f953f226f7158347d007622 Author: Jiri Olsa AuthorDate: Thu, 24 Aug 2017 18:27:34 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 28 Aug 2017 16:44:43 -0300 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 --- 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 9ac36bf..2c4af02 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; }