oprofile/x86: fix crash when profiling more than 28 events
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Mon, 18 Jan 2010 17:25:36 +0000 (11:25 -0600)
committerRobert Richter <robert.richter@amd.com>
Mon, 25 Jan 2010 14:34:53 +0000 (15:34 +0100)
With multiplexing enabled oprofile crashs when profiling more than 28
events. This patch fixes this.

Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Signed-off-by: Robert Richter <robert.richter@amd.com>
arch/x86/oprofile/nmi_int.c

index cb88b1a..76d4f56 100644 (file)
@@ -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;