Skip to content

Commit

Permalink
perfcounters/powerpc: fix oops with multiple counters in a group
Browse files Browse the repository at this point in the history
Impact: fix oops-causing bug

This fixes a bug in the powerpc hw_perf_counter_init where the code
didn't initialize ctrs[n] before passing the ctrs array to check_excludes,
leading to possible oopses and other incorrect behaviour.  This fixes it
by initializing ctrs[n] correctly.

Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Paul Mackerras committed Mar 5, 2009
1 parent b5e8acf commit 8602859
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/powerpc/kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ hw_perf_counter_init(struct perf_counter *counter)
return NULL;
}
events[n] = ev;
ctrs[n] = counter;
if (check_excludes(ctrs, n, 1))
return NULL;
if (power_check_constraints(events, n + 1))
Expand Down

0 comments on commit 8602859

Please sign in to comment.