[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-e59a8451be1162d5a10a33e40092f1796cb8fdca@git.kernel.org>
Date: Wed, 14 Oct 2015 00:42:31 -0700
From: tip-bot for Oleksij Rempel <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: shawnguo@...nel.org, kernel@...gutronix.de, linux@...pel-privat.de,
mingo@...nel.org, hpa@...or.com, linux-kernel@...r.kernel.org,
tglx@...utronix.de
Subject: [tip:irq/core] irqchip/mxs:
Panic if ioremap or domain creation fails
Commit-ID: e59a8451be1162d5a10a33e40092f1796cb8fdca
Gitweb: http://git.kernel.org/tip/e59a8451be1162d5a10a33e40092f1796cb8fdca
Author: Oleksij Rempel <linux@...pel-privat.de>
AuthorDate: Mon, 12 Oct 2015 21:15:30 +0200
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Wed, 14 Oct 2015 09:37:47 +0200
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: Oleksij Rempel <linux@...pel-privat.de>
Tested-by: Shawn Guo <shawnguo@...nel.org>
Cc: Sascha Hauer <kernel@...gutronix.de>
Cc: marc.zyngier@....com
Cc: jason@...edaemon.net
Link: http://lkml.kernel.org/r/1444677334-12242-2-git-send-email-linux@rempel-privat.de
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
---
drivers/irqchip/irq-mxs.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-mxs.c b/drivers/irqchip/irq-mxs.c
index 604df63..96148a7 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
@@ -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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists