From: Roel Kluin Date: Mon, 13 Jul 2009 00:25:47 +0000 (+0200) Subject: perf_counter tools: Fix index boundary check X-Git-Tag: v3.0~8404^2~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=23cdb5d5171d591ec911aada682e09d53c14a810;p=platform%2Fkernel%2Flinux-amlogic.git perf_counter tools: Fix index boundary check Keep index within event_type_descriptors[] Signed-off-by: Roel Kluin Cc: Andrew Morton Cc: Peter Zijlstra Cc: Mike Galbraith Cc: Paul Mackerras Cc: Arnaldo Carvalho de Melo Cc: Frederic Weisbecker LKML-Reference: <4A5A7F0B.4070106@gmail.com> Signed-off-by: Ingo Molnar --- diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 518a33a..d18c98e 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -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)