[PATCH v7 1/3] ARM: irqchip: mxs: do panic if icoll_base == NULL

From: Oleksij Rempel
Date: Mon Oct 12 2015 - 15:17:39 EST


Current code will only WARN_ON() and dereference the NULL pointer.
In this case it is better to panic and stop execution.

Signed-off-by: Oleksij Rempel <linux@xxxxxxxxxxxxxxxx>
---
drivers/irqchip/irq-mxs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-mxs.c b/drivers/irqchip/irq-mxs.c
index 604df63..ce69860 100644
--- a/drivers/irqchip/irq-mxs.c
+++ b/drivers/irqchip/irq-mxs.c
@@ -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
--
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/