linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: OMAP4: Fix array size for irq_target_cpu
@ 2012-09-05  0:03 Tony Lindgren
  2012-09-05  4:58 ` Shilimkar, Santosh
  2012-09-05 11:41 ` Benoit Cousson
  0 siblings, 2 replies; 5+ messages in thread
From: Tony Lindgren @ 2012-09-05  0:03 UTC (permalink / raw)
  To: linux-arm-kernel

If NR_IRQS is less than MAX_IRQS, we end up writing past the
irq_target_cpu array in omap_wakeupgen_init():

/* Associate all the IRQs to boot CPU like GIC init does. */
for (i = 0; i < max_irqs; i++)
	irq_target_cpu[i] = boot_cpu;

This can happen if SPARSE_IRQ is enabled as by default NR_IRQS is
set to 16. Without this patch we're overwriting other data during
the boot.

Signed-off-by: Tony Lindgren <tony@atomide.com>

--- a/arch/arm/mach-omap2/omap-wakeupgen.c
+++ b/arch/arm/mach-omap2/omap-wakeupgen.c
@@ -47,7 +47,7 @@
 static void __iomem *wakeupgen_base;
 static void __iomem *sar_base;
 static DEFINE_SPINLOCK(wakeupgen_lock);
-static unsigned int irq_target_cpu[NR_IRQS];
+static unsigned int irq_target_cpu[MAX_IRQS];
 static unsigned int irq_banks = MAX_NR_REG_BANKS;
 static unsigned int max_irqs = MAX_IRQS;
 static unsigned int omap_secure_apis;

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-09-05 16:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-05  0:03 [PATCH] ARM: OMAP4: Fix array size for irq_target_cpu Tony Lindgren
2012-09-05  4:58 ` Shilimkar, Santosh
2012-09-05 11:41 ` Benoit Cousson
2012-09-05 13:16   ` Shilimkar, Santosh
2012-09-05 16:51     ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).