mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-22 01:10:28 +00:00
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>
This commit is contained in:
parent
6b99ecec25
commit
892ee92b81
@ -12,6 +12,7 @@
|
|||||||
#include <linux/irq.h>
|
#include <linux/irq.h>
|
||||||
#include <asm/page.h>
|
#include <asm/page.h>
|
||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
|
#include <linux/bug.h>
|
||||||
|
|
||||||
#include <asm/prom.h>
|
#include <asm/prom.h>
|
||||||
#include <asm/irq.h>
|
#include <asm/irq.h>
|
||||||
@ -130,6 +131,7 @@ void __init init_IRQ(void)
|
|||||||
if (intc)
|
if (intc)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
BUG_ON(!intc);
|
||||||
|
|
||||||
intc_baseaddr = *(int *) of_get_property(intc, "reg", NULL);
|
intc_baseaddr = *(int *) of_get_property(intc, "reg", NULL);
|
||||||
intc_baseaddr = (unsigned long) ioremap(intc_baseaddr, PAGE_SIZE);
|
intc_baseaddr = (unsigned long) ioremap(intc_baseaddr, PAGE_SIZE);
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include <linux/clocksource.h>
|
#include <linux/clocksource.h>
|
||||||
#include <linux/clockchips.h>
|
#include <linux/clockchips.h>
|
||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
|
#include <linux/bug.h>
|
||||||
#include <asm/cpuinfo.h>
|
#include <asm/cpuinfo.h>
|
||||||
#include <asm/setup.h>
|
#include <asm/setup.h>
|
||||||
#include <asm/prom.h>
|
#include <asm/prom.h>
|
||||||
@ -234,6 +235,7 @@ void __init time_init(void)
|
|||||||
if (timer)
|
if (timer)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
BUG_ON(!timer);
|
||||||
|
|
||||||
timer_baseaddr = *(int *) of_get_property(timer, "reg", NULL);
|
timer_baseaddr = *(int *) of_get_property(timer, "reg", NULL);
|
||||||
timer_baseaddr = (unsigned long) ioremap(timer_baseaddr, PAGE_SIZE);
|
timer_baseaddr = (unsigned long) ioremap(timer_baseaddr, PAGE_SIZE);
|
||||||
|
Loading…
Reference in New Issue
Block a user