summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2008-12-02 07:21:21 +0100
committerRobert Richter <robert.richter@amd.com>2008-12-03 15:58:51 +0100
commit9ea84ad77d635bdb76c9a08f44f21a9af98359ee (patch)
treef1ec975d7c665d379d5b456a2a9951cdae59de2b /arch/x86
parent061e41fdb5047b1fb161e89664057835935ca1d2 (diff)
downloadlinux-9ea84ad77d635bdb76c9a08f44f21a9af98359ee.tar.bz2
oprofile: fix CPU unplug panic in ppro_stop()
If oprofile statically compiled in kernel, a cpu unplug triggers a panic in ppro_stop(), because a NULL pointer is dereferenced. Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/oprofile/op_model_ppro.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c
index 716d26f0e5d4..e9f80c744cf3 100644
--- a/arch/x86/oprofile/op_model_ppro.c
+++ b/arch/x86/oprofile/op_model_ppro.c
@@ -156,6 +156,8 @@ static void ppro_start(struct op_msrs const * const msrs)
unsigned int low, high;
int i;
+ if (!reset_value)
+ return;
for (i = 0; i < num_counters; ++i) {
if (reset_value[i]) {
CTRL_READ(low, high, msrs, i);
@@ -171,6 +173,8 @@ static void ppro_stop(struct op_msrs const * const msrs)
unsigned int low, high;
int i;
+ if (!reset_value)
+ return;
for (i = 0; i < num_counters; ++i) {
if (!reset_value[i])
continue;