Commit ce677831 authored by Dan Carpenter's avatar Dan Carpenter Committed by Ingo Molnar

perf: Fix off by one in perf_swevent_init()

The perf_swevent_enabled[] array has PERF_COUNT_SW_MAX elements.
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20101024195041.GT5985@bicker>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 51676957
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment