perf_counter/powerpc: Check oprofile_cpu_type for NULL before using it
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 6 Aug 2009 11:16:44 +0000 (21:16 +1000)
committerIngo Molnar <mingo@elte.hu>
Thu, 6 Aug 2009 11:55:09 +0000 (13:55 +0200)
commite0d82a0a4e9841b787e6431ccfbb515546c55dc2
tree5fe4ea05533ca0c60f90e27bd5fd9c3aacbcd668
parentaf6af30c0fcd77e621638e53ef8b176bca8bd3b4
perf_counter/powerpc: Check oprofile_cpu_type for NULL before using it

If the current CPU doesn't support performance counters,
cur_cpu_spec->oprofile_cpu_type can be NULL. The current
perf_counter modules don't test for that case and would thus
crash at boot time.

Bug reported by David Woodhouse.

Reported-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Paul Mackerras <paulus@samba.org>
LKML-Reference: <19066.48028.446975.501454@cargo.ozlabs.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/powerpc/kernel/mpc7450-pmu.c
arch/powerpc/kernel/power4-pmu.c
arch/powerpc/kernel/power5+-pmu.c
arch/powerpc/kernel/power5-pmu.c
arch/powerpc/kernel/power6-pmu.c
arch/powerpc/kernel/power7-pmu.c
arch/powerpc/kernel/ppc970-pmu.c