x86, perf: Fix NULL deref on not assigned x86_pmu
authorCyrill Gorcunov <gorcunov@gmail.com>
Thu, 11 Mar 2010 21:50:16 +0000 (00:50 +0300)
committerIngo Molnar <mingo@elte.hu>
Fri, 12 Mar 2010 09:18:42 +0000 (10:18 +0100)
commit0b861225a5890f22445f08ca9cc7a87cff276ff7
tree324ff942381746878090b8a22128c532dd7ffcbd
parenta072738e04f0eb26370e39ec679e9a0d65e49aea
x86, perf: Fix NULL deref on not assigned x86_pmu

In case of not assigned x86_pmu and software events NULL dereference may
being hit via x86_pmu::schedule_events method.

Fix it by checking if x86_pmu is initialized at all.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Lin Ming <ming.m.lin@intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Robert Richter <robert.richter@amd.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <20100311215016.GG25162@lenovo>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/cpu/perf_event.c