Skip to contentSkip to conversation

apha show_interrups() trashes argument

PATCH New Eric Sesterhenn / snakebyte 1 participant 1 message Jan 25, 2006 Alpha port

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 apha show_interrups() trashes argument

hi,

this is a bug found by cpminer. The show_interrupts function reuses i as a for loop counter, and therefore trashes its contents, which are needed later.

arch/alpha/kernel/irq.c renamed from arch/alpha/kernel/irq.c.orig +3 -3
@@ -75,9 +75,9 @@ show_interrupts(struct seq_file *p, void
 #ifdef CONFIG_SMP
 	if (i == 0) {
 		seq_puts(p, "           ");
-		for (i = 0; i < NR_CPUS; i++)
-			if (cpu_online(i))
-				seq_printf(p, "CPU%d       ", i);
+		for (j = 0; j < NR_CPUS; j++)
+			if (cpu_online(j))
+				seq_printf(p, "CPU%d       ", j);
 		seq_putc(p, '\n');
 	}
 #endif