提交 ce677831 编写于 作者: D Dan Carpenter 提交者: 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: NDan Carpenter <error27@gmail.com>
Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20101024195041.GT5985@bicker>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册