Commit 37f70c38 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Greg Kroah-Hartman

perf/x86/intel: Fix constraint access

commit ebfb4988 upstream.

Sasha reported that we can get here with .idx==-1, and
cpuc->event_constraints unallocated.
Suggested-by: default avatarStephane Eranian <eranian@google.com>
Reported-by: default avatarSasha Levin <sasha.levin@oracle.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: b371b594 ("perf/x86: Fix event/group validation")
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 61be5a59
......@@ -2098,9 +2098,12 @@ static struct event_constraint *
intel_get_event_constraints(struct cpu_hw_events *cpuc, int idx,
struct perf_event *event)
{
struct event_constraint *c1 = cpuc->event_constraint[idx];
struct event_constraint *c1 = NULL;
struct event_constraint *c2;
if (idx >= 0) /* fake does < 0 */
c1 = cpuc->event_constraint[idx];
/*
* first time only
* - static constraint: no change across incremental scheduling calls
......
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