Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1605241

[PATCH 10/11] perf probe: Fix concat_probe_trace_events

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 10/11] perf probe: Fix concat_probe_trace_events
Date 2017-03-21 02:30 +0100
Message-ID <tngMx-4Et-5@gated-at.bofh.it> (permalink)
References <tngCR-4AF-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>

'*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 <ravi.bangoria@linux.vnet.ibm.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
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 <acme@redhat.com>
---
 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 b19d17801beb..6740d6812691 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;
-- 
2.9.3

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[GIT PULL 00/11] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-21 02:20 +0100
  [PATCH 01/11] perf lock: Subcommands should include common options Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-21 02:20 +0100
  [PATCH 10/11] perf probe: Fix concat_probe_trace_events Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-21 02:30 +0100
  [PATCH 05/11] tools include: Sync {,tools/}include/uapi/linux/perf_event.h Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-21 02:30 +0100
  [PATCH 09/11] perf stat: Correct --no-aggr description Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-21 02:30 +0100
  Re: [GIT PULL 00/11] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2017-03-21 07:50 +0100

csiph-web