[ 3.5.y.z extended stable ] Patch "perf/arm: Fix armpmu_map_hw_event()" has been added to staging queue
Luis Henriques
luis.henriques at canonical.com
Fri Aug 16 09:31:15 UTC 2013
This is a note to let you know that I have just added a patch titled
perf/arm: Fix armpmu_map_hw_event()
to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree
which can be found at:
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Luis
------
>From 5a6d43f5b954efe897f5d840380b0231bd9dad3c Mon Sep 17 00:00:00 2001
From: Stephen Boyd <sboyd at codeaurora.org>
Date: Wed, 7 Aug 2013 16:18:08 -0700
Subject: [PATCH] perf/arm: Fix armpmu_map_hw_event()
commit b88a2595b6d8aedbd275c07dfa784657b4f757eb upstream.
Fix constraint check in armpmu_map_hw_event().
Reported-and-tested-by: Vince Weaver <vincent.weaver at maine.edu>
Signed-off-by: Ingo Molnar <mingo at kernel.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
arch/arm/kernel/perf_event.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index 55790a5..c716dbd 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -109,7 +109,12 @@ armpmu_map_cache_event(const unsigned (*cache_map)
static int
armpmu_map_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;
}
--
1.8.3.2
More information about the kernel-team
mailing list