]> git.baikalelectronics.ru Git - kernel.git/commit
perf_counter: powerpc: initialize cpuhw pointer before use
authorPaul Mackerras <paulus@samba.org>
Mon, 18 May 2009 04:02:12 +0000 (14:02 +1000)
committerIngo Molnar <mingo@elte.hu>
Mon, 18 May 2009 05:38:42 +0000 (07:38 +0200)
commit23fe1f861efdaf0495e57924dee60059d3560e35
tree640c68ca92430ef5edc4b161f306cd2840e63e1c
parentd10a45739d797c0b47ece1e7b9bdf694f05e2c7f
perf_counter: powerpc: initialize cpuhw pointer before use

Commit 3a00654d ("perf_counter: Rework the perf counter
disable/enable") added code to the powerpc hw_perf_enable (renamed
from hw_perf_restore) to test cpuhw->disabled and return immediately
if it is not set (i.e. if the PMU is already enabled).

Unfortunately the test got added before cpuhw was initialized,
resulting in an oops the first time hw_perf_enable got called.
This fixes it by moving the initialization of cpuhw to before
cpuhw->disabled is tested.

[ Impact: fix oops-causing bug on powerpc ]

Signed-off-by: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
LKML-Reference: <18960.56772.869734.304631@drongo.ozlabs.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/powerpc/kernel/perf_counter.c