linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] perf probe: Fix concat_probe_trace_events
@ 2017-03-08  6:59 Ravi Bangoria
  2017-03-08  6:59 ` [PATCH 2/2] perf probe: Remove stale func add_perf_probe_events Ravi Bangoria
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ravi Bangoria @ 2017-03-08  6:59 UTC (permalink / raw)
  To: mhiramat, acme
  Cc: peterz, mingo, alexander.shishkin, linux-kernel, Ravi Bangoria

'*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'.

Fixes: 42bba263eb58 ("perf probe: Allow wildcard for cached events")
Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.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 28fb62c..4f9d6ee 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -3057,7 +3057,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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-03-21  7:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-08  6:59 [PATCH 1/2] perf probe: Fix concat_probe_trace_events Ravi Bangoria
2017-03-08  6:59 ` [PATCH 2/2] perf probe: Remove stale func add_perf_probe_events Ravi Bangoria
2017-03-08  9:43   ` Masami Hiramatsu
2017-03-08  9:58     ` Ravi Bangoria
2017-03-08  8:37 ` [PATCH 1/2] perf probe: Fix concat_probe_trace_events Masami Hiramatsu
2017-03-20  9:33   ` Ravi Bangoria
2017-03-20 13:39     ` Arnaldo Carvalho de Melo
2017-03-21  6:53 ` [tip:perf/core] " tip-bot for Ravi Bangoria

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).