Skip to contentSkip to conversation

Keep index within event_type_descriptors[]

PATCH In review Roel Kluin 1 participant 2 messages Jul 13, 2009 perf events

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 Keep index within event_type_descriptors[]

Keep index within event_type_descriptors[]

---

tools/perf/util/parse-events.c +1 -1
index 518a33a..d18c98e 100644
@@ -436,7 +436,7 @@ void print_events(void)
 
 	for (i = 0; i < ARRAY_SIZE(event_symbols); i++, syms++) {
 		type = syms->type + 1;
-		if (type > ARRAY_SIZE(event_type_descriptors))
+		if (type >= ARRAY_SIZE(event_type_descriptors))
 			type = 0;
 
 		if (type != prev_type)
#1 lore raw

[tip:perfcounters/urgent] perf_counter tools: Fix index boundary check

Commit-ID:  23cdb5d5171d591ec911aada682e09d53c14a810
Gitweb:     http://git.kernel.org/tip/23cdb5d5171d591ec911aada682e09d53c14a810
Author:     Roel Kluin <[email protected]>
AuthorDate: Mon, 13 Jul 2009 02:25:47 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 13 Jul 2009 10:58:28 +0200

perf_counter tools: Fix index boundary check

Keep index within event_type_descriptors[]

Cc Andrew Morton <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Frederic Weisbecker <[email protected]>

LKML-Reference: <[email protected]>

---
 tools/perf/util/parse-events.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tools/perf/util/parse-events.c +1 -1
index 518a33a..d18c98e 100644
@@ -436,7 +436,7 @@ void print_events(void)
 
 	for (i = 0; i < ARRAY_SIZE(event_symbols); i++, syms++) {
 		type = syms->type + 1;
-		if (type > ARRAY_SIZE(event_type_descriptors))
+		if (type >= ARRAY_SIZE(event_type_descriptors))
 			type = 0;
 
 		if (type != prev_type)