Skip to contentSkip to conversation

oprofile/x86: fix crash when profiling more than 28 events

PATCH New Robert Richter 1 participant 1 message Jan 25, 2010 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 oprofile/x86: fix crash when profiling more than 28 events

From: Suravee Suthikulpanit <[email protected]>

With multiplexing enabled oprofile crashs when profiling more than 28 events. This patch fixes this.

---
 arch/x86/oprofile/nmi_int.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/oprofile/nmi_int.c +1 -1
index cb88b1a..76d4f56 100644
@@ -222,7 +222,7 @@ static void nmi_cpu_switch(void *dummy)
 
 	/* move to next set */
 	si += model->num_counters;
-	if ((si > model->num_virt_counters) || (counter_config[si].count == 0))
+	if ((si >= model->num_virt_counters) || (counter_config[si].count == 0))
 		per_cpu(switch_index, cpu) = 0;
 	else
 		per_cpu(switch_index, cpu) = si;
Signature · 1 line
1.6.6