Commit e59a8451 authored by Oleksij Rempel's avatar Oleksij Rempel Committed by Thomas Gleixner

irqchip/mxs: Panic if ioremap or domain creation fails

Current code will only warn and then dereference the NULL pointer or
continue, which results in a fatal NULL pointer dereference later.

If the initialization fails, the machine is unusable, so panic right
away.

[ tglx: Massaged changelog and picked the irqdomain panic from the
  	next patch]
Signed-off-by: default avatarOleksij Rempel <linux@rempel-privat.de>
Tested-by: default avatarShawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: marc.zyngier@arm.com
Cc: jason@lakedaemon.net
Link: http://lkml.kernel.org/r/1444677334-12242-2-git-send-email-linux@rempel-privat.deSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent e7a46c81
......@@ -97,7 +97,8 @@ static int __init icoll_of_init(struct device_node *np,
struct device_node *interrupt_parent)
{
icoll_base = of_iomap(np, 0);
WARN_ON(!icoll_base);
if (!icoll_base)
panic("%s: unable to map resource", np->full_name);
/*
* Interrupt Collector reset, which initializes the priority
......@@ -107,6 +108,9 @@ static int __init icoll_of_init(struct device_node *np,
icoll_domain = irq_domain_add_linear(np, ICOLL_NUM_IRQS,
&icoll_irq_domain_ops, NULL);
return icoll_domain ? 0 : -ENODEV;
if (!icoll_domain)
panic("%s: unable to create irqdomain", np->full_name);
return 0;
}
IRQCHIP_DECLARE(mxs, "fsl,icoll", icoll_of_init);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment