summaryrefslogtreecommitdiffstats
path: root/arch/microblaze/kernel/intc.c
diff options
context:
space:
mode:
authorJohn Williams <john.williams@petalogix.com>2009-07-29 22:08:40 +1000
committerMichal Simek <monstr@monstr.eu>2009-08-18 10:33:30 +0200
commit892ee92b81b6e7fa5f6147c96e11c6c1b9802fc6 (patch)
tree8ae8086fe126192fb4fd68a37811db24599048a3 /arch/microblaze/kernel/intc.c
parent6b99ecec25c8fd501e74306f5d23dd0365065e2a (diff)
microblaze: Sane handling of missing timer/intc in device tree
This code path doesn't test any returned pointers for NULL, leading to a bad kernel page fault if there's no timer/intc found. Slightly better is to BUG(), but even better still would be a printk beforehand. Signed-off-by: John Williams <john.williams@petalogix.com> Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze/kernel/intc.c')
-rw-r--r--arch/microblaze/kernel/intc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/microblaze/kernel/intc.c b/arch/microblaze/kernel/intc.c
index b15605299a5..6eea6f92b84 100644
--- a/arch/microblaze/kernel/intc.c
+++ b/arch/microblaze/kernel/intc.c
@@ -12,6 +12,7 @@
#include <linux/irq.h>
#include <asm/page.h>
#include <linux/io.h>
+#include <linux/bug.h>
#include <asm/prom.h>
#include <asm/irq.h>
@@ -130,6 +131,7 @@ void __init init_IRQ(void)
if (intc)
break;
}
+ BUG_ON(!intc);
intc_baseaddr = *(int *) of_get_property(intc, "reg", NULL);
intc_baseaddr = (unsigned long) ioremap(intc_baseaddr, PAGE_SIZE);