Re: [PATCH] protect 'action' in show_interrupts

Russell King (rmk@arm.linux.org.uk)
Fri, 7 Mar 2003 15:46:43 +0000


On Fri, Mar 07, 2003 at 10:32:13AM -0500, Zwane Mwaikambo wrote:
> --- linux-2.5.64/arch/arm/kernel/irq.c 5 Mar 2003 05:08:11 -0000 1.1.1.1
> +++ linux-2.5.64/arch/arm/kernel/irq.c 7 Mar 2003 15:05:36 -0000
> @@ -165,17 +165,22 @@
> {
> int i;
> struct irqaction * action;
> + unsigned long flags;
>
> for (i = 0 ; i < NR_IRQS ; i++) {
> + spin_lock_irqsave(&irq_desc[i].lock, flags);
> action = irq_desc[i].action;
> if (!action)
> - continue;
> + goto unlock;
> +
> seq_printf(p, "%3d: %10u ", i, kstat_irqs(i));
> seq_printf(p, " %s", action->name);
> - for (action = action->next; action; action = action->next) {
> + for (action = action->next; action; action = action->next)
> seq_printf(p, ", %s", action->name);
> - }
> +
> seq_putc(p, '\n');
> +unlock:
> + spin_unlock_irqrestore(&irq_desc[i].lock, flags);
> }
>
> #ifdef CONFIG_ARCH_ACORN

We don't have a per-irq_desc spinlock on ARM - it's a global
irq_controller_lock.

Thanks.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/