summaryrefslogtreecommitdiff
path: root/drivers/irqchip
diff options
context:
space:
mode:
authorJon Hunter <jonathanh@nvidia.com>2016-05-10 16:14:40 +0100
committerMarc Zyngier <marc.zyngier@arm.com>2016-05-11 10:12:42 +0100
commit26acfe7463dc7162e595a8f7bd7ef3e06111e25d (patch)
tree057529e0cccad9423d2d29becb8099baa34c58fe /drivers/irqchip
parent992345a58e0cbcd63c26226e3e818b4583c4a34d (diff)
irqchip/gic: Don't initialise chip if mapping IO space fails
If we fail to map the address space for the GIC distributor or CPU interface, then don't attempt to initialise the chip, just WARN and return. Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Acked-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'drivers/irqchip')
-rw-r--r--drivers/irqchip/irq-gic.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 5c4da5808b15..612a3584a282 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -1209,10 +1209,14 @@ gic_of_init(struct device_node *node, struct device_node *parent)
return -ENODEV;
dist_base = of_iomap(node, 0);
- WARN(!dist_base, "unable to map gic dist registers\n");
+ if (WARN(!dist_base, "unable to map gic dist registers\n"))
+ return -ENOMEM;
cpu_base = of_iomap(node, 1);
- WARN(!cpu_base, "unable to map gic cpu registers\n");
+ if (WARN(!cpu_base, "unable to map gic cpu registers\n")) {
+ iounmap(dist_base);
+ return -ENOMEM;
+ }
/*
* Disable split EOI/Deactivate if either HYP is not available