Skip to content

Commit

Permalink
oprofile: fix CPU unplug panic in ppro_stop()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Robert Richter <[email protected]>
  • Loading branch information
Eric Dumazet authored and Robert Richter committed Dec 3, 2008
1 parent 061e41f commit 9ea84ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/x86/oprofile/op_model_ppro.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit 9ea84ad

Please sign in to comment.