aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-10-24 15:50:42 -0400
committerIngo Molnar <mingo@elte.hu>2010-12-16 05:14:31 -0500
commitce677831a4abd0f9f957c90ac6f6a0d0472bafb4 (patch)
tree755fb098fa0e27bfa710272cd5686dabc7922360
parent5167695753c63444a9e6cbbef136200a16c7a225 (diff)
perf: Fix off by one in perf_swevent_init()
The perf_swevent_enabled[] array has PERF_COUNT_SW_MAX elements. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <20101024195041.GT5985@bicker> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--kernel/perf_event.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 7b870174c56d..2870feee81dd 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -4719,7 +4719,7 @@ static int perf_swevent_init(struct perf_event *event)
4719 break; 4719 break;
4720 } 4720 }
4721 4721
4722 if (event_id > PERF_COUNT_SW_MAX) 4722 if (event_id >= PERF_COUNT_SW_MAX)
4723 return -ENOENT; 4723 return -ENOENT;
4724 4724
4725 if (!event->parent) { 4725 if (!event->parent) {