Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932306AbdCUHoz (ORCPT ); Tue, 21 Mar 2017 03:44:55 -0400 Received: from terminus.zytor.com ([65.50.211.136]:34574 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755395AbdCUHnN (ORCPT ); Tue, 21 Mar 2017 03:43:13 -0400 Date: Mon, 20 Mar 2017 23:53:37 -0700 From: tip-bot for Ravi Bangoria Message-ID: Cc: acme@redhat.com, tglx@linutronix.de, peterz@infradead.org, ravi.bangoria@linux.vnet.ibm.com, mhiramat@kernel.org, alexander.shishkin@linux.intel.com, hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@kernel.org Reply-To: mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, alexander.shishkin@linux.intel.com, mhiramat@kernel.org, ravi.bangoria@linux.vnet.ibm.com, peterz@infradead.org, tglx@linutronix.de, acme@redhat.com In-Reply-To: <20170308065908.4128-1-ravi.bangoria@linux.vnet.ibm.com> References: <20170308065908.4128-1-ravi.bangoria@linux.vnet.ibm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf probe: Fix concat_probe_trace_events Git-Commit-ID: f0a30dca5f84fe8048271799b56677ac2279de66 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 Content-Length: 1553 Lines: 38 Commit-ID: f0a30dca5f84fe8048271799b56677ac2279de66 Gitweb: http://git.kernel.org/tip/f0a30dca5f84fe8048271799b56677ac2279de66 Author: Ravi Bangoria AuthorDate: Wed, 8 Mar 2017 12:29:07 +0530 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 20 Mar 2017 15:01:32 -0300 perf probe: Fix concat_probe_trace_events '*ntevs' contains number of elements present in 'tevs' array. If there are no elements in array, 'tevs2' can be directly assigned to 'tevs' without allocating more space. So the condition should be '*ntevs == 0' not 'ntevs == 0'. Signed-off-by: Ravi Bangoria Acked-by: Masami Hiramatsu Cc: Alexander Shishkin Cc: Peter Zijlstra Fixes: 42bba263eb58 ("perf probe: Allow wildcard for cached events") Link: http://lkml.kernel.org/r/20170308065908.4128-1-ravi.bangoria@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/probe-event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index b19d178..6740d68 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c @@ -3048,7 +3048,7 @@ concat_probe_trace_events(struct probe_trace_event **tevs, int *ntevs, struct probe_trace_event *new_tevs; int ret = 0; - if (ntevs == 0) { + if (*ntevs == 0) { *tevs = *tevs2; *ntevs = ntevs2; *tevs2 = NULL;