diff options
author | Paul Mackerras <paulus@samba.org> | 2009-03-04 22:05:57 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2009-03-05 16:07:13 -0500 |
commit | 86028598de16538f02519141756ccf4accfc29a6 (patch) | |
tree | b2afaf03f578547bda536d0d99e87636e59216ea /arch/powerpc/kernel/perf_counter.c | |
parent | b5e8acf66ff5db707c7e08df49fdf6b415878442 (diff) |
perfcounters/powerpc: fix oops with multiple counters in a group
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>
Diffstat (limited to 'arch/powerpc/kernel/perf_counter.c')
-rw-r--r-- | arch/powerpc/kernel/perf_counter.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/perf_counter.c b/arch/powerpc/kernel/perf_counter.c index 112332d07fc2..4fec112386fc 100644 --- a/arch/powerpc/kernel/perf_counter.c +++ b/arch/powerpc/kernel/perf_counter.c | |||
@@ -633,6 +633,7 @@ hw_perf_counter_init(struct perf_counter *counter) | |||
633 | return NULL; | 633 | return NULL; |
634 | } | 634 | } |
635 | events[n] = ev; | 635 | events[n] = ev; |
636 | ctrs[n] = counter; | ||
636 | if (check_excludes(ctrs, n, 1)) | 637 | if (check_excludes(ctrs, n, 1)) |
637 | return NULL; | 638 | return NULL; |
638 | if (power_check_constraints(events, n + 1)) | 639 | if (power_check_constraints(events, n + 1)) |