aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/kernel/perf_event.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-08-21 12:53:05 +0100
committerMark Brown <broonie@linaro.org>2013-08-21 12:53:05 +0100
commit4c4ca6a49f1a580666912153b8501331f7b4f379 (patch)
treedffa1560a0aa36a3fc46121fd8f49de135834635 /arch/arm/kernel/perf_event.c
parenta3cf22a4a40437cf8fe366078548e0d2c55c01a7 (diff)
parent0a4b6d4ff200a553951f77f765971cb3e4c91ec0 (diff)
downloadvexpress-lsk-4c4ca6a49f1a580666912153b8501331f7b4f379.tar.gz
Merge tag 'v3.10.9' into linux-linaro-lsk
This is the 3.10.9 stable release
Diffstat (limited to 'arch/arm/kernel/perf_event.c')
-rw-r--r--arch/arm/kernel/perf_event.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index 9e7076df89e..3a9d627cab6 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -54,7 +54,12 @@ armpmu_map_cache_event(const unsigned (*cache_map)
static int
armpmu_map_hw_event(const unsigned (*event_map)[PERF_COUNT_HW_MAX], u64 config)
{
- int mapping = (*event_map)[config];
+ int mapping;
+
+ if (config >= PERF_COUNT_HW_MAX)
+ return -ENOENT;
+
+ mapping = (*event_map)[config];
return mapping == HW_OP_UNSUPPORTED ? -ENOENT : mapping;
}
@@ -268,6 +273,9 @@ validate_event(struct pmu_hw_events *hw_events,
struct arm_pmu *armpmu = to_arm_pmu(event->pmu);
struct pmu *leader_pmu = event->group_leader->pmu;
+ if (is_software_event(event))
+ return 1;
+
if (event->pmu != leader_pmu || event->state < PERF_EVENT_STATE_OFF)
return 1;