From: Jon Hunter Date: Tue, 10 May 2016 15:14:40 +0000 (+0100) Subject: irqchip/gic: Don't initialise chip if mapping IO space fails X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=26acfe7463dc7162e595a8f7bd7ef3e06111e25d;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Acked-by: Marc Zyngier Signed-off-by: Marc Zyngier --- 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