From patchwork Tue Jul 24 16:49:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 10542563 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8949D1822 for ; Tue, 24 Jul 2018 16:50:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 777CD2914F for ; Tue, 24 Jul 2018 16:50:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 757E829124; Tue, 24 Jul 2018 16:50:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 19AA02917E for ; Tue, 24 Jul 2018 16:50:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ahWtRW/glhHmowrfrTmahoL9BDExguRrpaPgP1SS/J4=; b=Aee2a3cHKTEhwR /fv7zfYyW9tXxXI31D9aIg7Wy93g1xWakfF+OFtdh9mALytEOxRSRg2hUI7VZOON5Hp+g8Ku6a75b WSSJt5tI4WVKaL7EAZLHQrsExwBBAxqGQtC2y5nKhGtymyFNHQzApZIkXoaoyvd2t2nHo3d7MN3pg aMgjPDsT7+n4qwUOSKxdepvqY7WyhHKkdX3IqYZCmlGLnSKlr8waW14LQRrYinRHa2PwaFqRIciGv msoTjLFuZxMwO8qWczxGDetleaTru766w8QTuDrpHlEfF4HhyNEVmRU1PYMyb5AI3DlRLdFBGW5qW rP3ye0j7CacUr9Oetnmw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fi0WG-0001XL-N0; Tue, 24 Jul 2018 16:50:40 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fi0WA-0001FH-VJ for linux-arm-kernel@lists.infradead.org; Tue, 24 Jul 2018 16:50:39 +0000 Received: from localhost.localdomain (xdsl-188-155-58-14.adslplus.ch [188.155.58.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4EA7720883; Tue, 24 Jul 2018 16:50:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532451029; bh=12umIieZcuTxguc4cgZt2eNAjuSBXV7eA2Lj+nsGSgE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=of1YjaVGaO5Z4lnHWB+B95pHHnH8QIqonga6XGXzkZ+YwYCQVtHmpoyITdei7iFFc OmWUTR+RpzBgaVWUcuGx/4McF714uW5MpPIHPXzuWJQlEIoALvTP3WMK8cRlY9Xizn mJaBzgeLeUi7Jxd3BG7DAUJ9Hfza67BHQN/IoOz4= From: Krzysztof Kozlowski To: Kukjin Kim , Krzysztof Kozlowski , Russell King , Alim Akhtar , Marek Szyprowski , Pankaj Dubey , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/4] ARM: exynos: Clear global variable on init error path Date: Tue, 24 Jul 2018 18:49:45 +0200 Message-Id: <20180724164946.6274-3-krzk@kernel.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180724164946.6274-1-krzk@kernel.org> References: <20180724164946.6274-1-krzk@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180724_095035_092408_955E1255 X-CRM114-Status: GOOD ( 13.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP For most of Exynos SoCs, Power Management Unit (PMU) address space is mapped into global variable 'pmu_base_addr' very early when initializing PMU interrupt controller. A lot of other machine code depends on it so when doing iounmap() on this address, clear the global as well to avoid usage of invalid value (pointing to unmapped memory region). Properly mapped PMU address space is a requirement for all other machine code so this fix is purely theoretical. Boot will fail immediately in many other places after following this error path. Signed-off-by: Krzysztof Kozlowski --- Changes since v1: New patch. --- arch/arm/mach-exynos/suspend.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c index 5d4822e5d0ba..d42ef1be2c70 100644 --- a/arch/arm/mach-exynos/suspend.c +++ b/arch/arm/mach-exynos/suspend.c @@ -207,6 +207,7 @@ static int __init exynos_pmu_irq_init(struct device_node *node, NULL); if (!domain) { iounmap(pmu_base_addr); + pmu_base_addr = NULL; return -ENOMEM; }