forked from Minki/linux
perf_counter tools: Fix index boundary check
Keep index within event_type_descriptors[] Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <4A5A7F0B.4070106@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
d4d7d0b954
commit
23cdb5d517
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user