summaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-06-23 20:39:02 +0200
committerDavid S. Miller <davem@davemloft.net>2010-06-23 20:39:02 +0200
commitb7d45c3f741b114cdda9ee0cd727afaf60a1bf37 (patch)
tree2712b7f5ddab5af1fbc67555d880216baefe7227 /arch/sparc
parentarch/sparc/kernel: Eliminate what looks like a NULL pointer dereference (diff)
downloadlinux-b7d45c3f741b114cdda9ee0cd727afaf60a1bf37.tar.xz
linux-b7d45c3f741b114cdda9ee0cd727afaf60a1bf37.zip
sparc64: Fix maybe_change_configuration() PCR setting.
Need to mask out the existing event bits before OR'ing in the new ones. Noticed by Peter Zijlstra. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/kernel/perf_event.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c
index 34ce49f80eac..2e1698332b6d 100644
--- a/arch/sparc/kernel/perf_event.c
+++ b/arch/sparc/kernel/perf_event.c
@@ -655,6 +655,7 @@ static u64 maybe_change_configuration(struct cpu_hw_events *cpuc, u64 pcr)
cpuc->current_idx[i] = idx;
enc = perf_event_get_enc(cpuc->events[i]);
+ pcr &= ~mask_for_index(idx);
pcr |= event_encoding(enc, idx);
}
out: