Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
fork

Configure Feed

Select the types of activity you want to include in your feed.

sparc32, leon: Check for existent irq_map entry in leon_handle_ext_irq

If an irq is being unlinked concurrently with leon_handle_ext_irq,
irq_map[eirq] might be null in leon_handle_ext_irq. Make sure that
this is not dereferenced.

Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Andreas Larsson and committed by
David S. Miller
20424d85 5cf8f7db

+4 -2
+4 -2
arch/sparc/kernel/leon_kernel.c
··· 56 56 static void leon_handle_ext_irq(unsigned int irq, struct irq_desc *desc) 57 57 { 58 58 unsigned int eirq; 59 + struct irq_bucket *p; 59 60 int cpu = sparc_leon3_cpuid(); 60 61 61 62 eirq = leon_eirq_get(cpu); 62 - if ((eirq & 0x10) && irq_map[eirq]->irq) /* bit4 tells if IRQ happened */ 63 - generic_handle_irq(irq_map[eirq]->irq); 63 + p = irq_map[eirq]; 64 + if ((eirq & 0x10) && p && p->irq) /* bit4 tells if IRQ happened */ 65 + generic_handle_irq(p->irq); 64 66 } 65 67 66 68 /* The extended IRQ controller has been found, this function registers it */