Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf/arm: Fix armpmu_map_hw_event()

Fix constraint check in armpmu_map_hw_event().

Reported-and-tested-by: Vince Weaver <vincent.weaver@maine.edu>
Cc: <stable@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Stephen Boyd and committed by
Linus Torvalds
b88a2595 e0acd0a6

+6 -1
+6 -1
arch/arm/kernel/perf_event.c
··· 53 53 static int 54 54 armpmu_map_hw_event(const unsigned (*event_map)[PERF_COUNT_HW_MAX], u64 config) 55 55 { 56 - int mapping = (*event_map)[config]; 56 + int mapping; 57 + 58 + if (config >= PERF_COUNT_HW_MAX) 59 + return -ENOENT; 60 + 61 + mapping = (*event_map)[config]; 57 62 return mapping == HW_OP_UNSUPPORTED ? -ENOENT : mapping; 58 63 } 59 64