Commit 29aaccfb authored by Andrew Morton's avatar Andrew Morton Committed by James Bottomley

[PATCH] i386 show_interrupts() fix

show_interrupts() is accidentally modifying the incoming seq_file pointer.
It goes oops if seq_printf() returns non-zero.
parent ac84c974
...@@ -140,7 +140,7 @@ int show_interrupts(struct seq_file *p, void *v) ...@@ -140,7 +140,7 @@ int show_interrupts(struct seq_file *p, void *v)
seq_printf(p, " "); seq_printf(p, " ");
for (j=0; j<NR_CPUS; j++) for (j=0; j<NR_CPUS; j++)
if (cpu_online(j)) if (cpu_online(j))
p += seq_printf(p, "CPU%d ",j); seq_printf(p, "CPU%d ",j);
seq_putc(p, '\n'); seq_putc(p, '\n');
for (i = 0 ; i < NR_IRQS ; i++) { for (i = 0 ; i < NR_IRQS ; i++) {
...@@ -154,8 +154,7 @@ int show_interrupts(struct seq_file *p, void *v) ...@@ -154,8 +154,7 @@ int show_interrupts(struct seq_file *p, void *v)
#else #else
for (j = 0; j < NR_CPUS; j++) for (j = 0; j < NR_CPUS; j++)
if (cpu_online(j)) if (cpu_online(j))
p += seq_printf(p, "%10u ", seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
kstat_cpu(j).irqs[i]);
#endif #endif
seq_printf(p, " %14s", irq_desc[i].handler->typename); seq_printf(p, " %14s", irq_desc[i].handler->typename);
seq_printf(p, " %s", action->name); seq_printf(p, " %s", action->name);
...@@ -170,13 +169,13 @@ int show_interrupts(struct seq_file *p, void *v) ...@@ -170,13 +169,13 @@ int show_interrupts(struct seq_file *p, void *v)
seq_printf(p, "NMI: "); seq_printf(p, "NMI: ");
for (j = 0; j < NR_CPUS; j++) for (j = 0; j < NR_CPUS; j++)
if (cpu_online(j)) if (cpu_online(j))
p += seq_printf(p, "%10u ", nmi_count(j)); seq_printf(p, "%10u ", nmi_count(j));
seq_putc(p, '\n'); seq_putc(p, '\n');
#if CONFIG_X86_LOCAL_APIC #if CONFIG_X86_LOCAL_APIC
seq_printf(p, "LOC: "); seq_printf(p, "LOC: ");
for (j = 0; j < NR_CPUS; j++) for (j = 0; j < NR_CPUS; j++)
if (cpu_online(j)) if (cpu_online(j))
p += seq_printf(p, "%10u ", irq_stat[j].apic_timer_irqs); seq_printf(p, "%10u ", irq_stat[j].apic_timer_irqs);
seq_putc(p, '\n'); seq_putc(p, '\n');
#endif #endif
seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment