From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752809AbcEJPZ7 (ORCPT ); Tue, 10 May 2016 11:25:59 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:7473 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752971AbcEJPPD (ORCPT ); Tue, 10 May 2016 11:15:03 -0400 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Tue, 10 May 2016 08:13:29 -0700 From: Jon Hunter To: Marc Zyngier CC: Thomas Gleixner , Jason Cooper , , , Jon Hunter Subject: [PATCH 06/11] irqchip/gic: Don't initialise chip if mapping IO space fails Date: Tue, 10 May 2016 16:14:40 +0100 Message-ID: <1462893285-13515-7-git-send-email-jonathanh@nvidia.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1462893285-13515-1-git-send-email-jonathanh@nvidia.com> References: <1462893285-13515-1-git-send-email-jonathanh@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/irqchip/irq-gic.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index 30d05a4639e4..070c87bbfce8 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -1225,10 +1225,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 -- 2.1.4