From: Dan Carpenter Date: Sun, 24 Oct 2010 19:50:42 +0000 (+0200) Subject: perf: Fix off by one in perf_swevent_init() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ce677831a4abd0f9f957c90ac6f6a0d0472bafb4;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: Peter Zijlstra LKML-Reference: <20101024195041.GT5985@bicker> Signed-off-by: Ingo Molnar --- 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) break; } - if (event_id > PERF_COUNT_SW_MAX) + if (event_id >= PERF_COUNT_SW_MAX) return -ENOENT; if (!event->parent) {