Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2478201imm; Mon, 24 Sep 2018 05:11:22 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbX4SvHM0tO+tD4j1Qbkvs3RVj9eyfsvpB5UxBMQbkdggZdKHN0OJjrfWA6iaTonp5+o/D3 X-Received: by 2002:a62:219b:: with SMTP id o27-v6mr10088350pfj.235.1537791081998; Mon, 24 Sep 2018 05:11:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537791081; cv=none; d=google.com; s=arc-20160816; b=Nf+w7rBg6lEfu27XSR4MjIQbNmBpFdKYvOjt18J2lRXJeEIOtGRJ8gpWGpuNmFjA+c q3p/c8WSj487gBkXCtHo84pTz8yB0slbKeCnIjgra8JpgKtpz+vmxnMPCCU7i3ji2zU/ bSjJcXktse0gDP01CoYrQes/zif8dDft/lDq/Kqcebt9C/E4pE7/n7uthvAmVgHRnDWq ViETyQZuDg7a6MatsbC0tFxdhOjlFAE/yV3ClofUpPuuGf55xcZE1zbrP6Z03WAt1xQE TuxLoG9gkp3KNhzeaoERwUnTGdSeNIw4JzA2KrBBs7pDt6vXXsfgbO9w54AU8kXl8sNR wsJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=qdQP80IoyPIW/C6fhHE9sKDZ84UhzfpErDJLx/x0vsQ=; b=Ept9dBEippffgUkY2Qwa3vDhnYSUhwE4Y+sQAgoKYvjj1XI2MRQP+RxEyiSoV/INfq PiR0AwjbMZ1u7RzSH8IX8jPznMUy/hfWfFEP5n2A/YVXRdtkhrTgHObttpsxMoo++XAp RXwgeO+F1+jSjE/g3fT20G1aWSAMhX1kMMmRRzx7SQcNnOMk8PPOWaP0EOB0IC54LR+L c2xq2KgvamZyxNEt0BHY6Ls3aCYAC8hAFpYMZe8ci9Zezl12TA6mT4wgrQ2zM62EP2VS Ov2kV64+Y7iuHn6a17ic4guykQvdLWo60L8T5dwv2qfYRf/9xq0+FDvD+H0kmVorYCfc WV4Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f190-v6si37839626pfc.327.2018.09.24.05.11.06; Mon, 24 Sep 2018 05:11:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730197AbeIXSCY (ORCPT + 99 others); Mon, 24 Sep 2018 14:02:24 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:53196 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729233AbeIXSCX (ORCPT ); Mon, 24 Sep 2018 14:02:23 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id B67031086; Mon, 24 Sep 2018 12:00:27 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , Sasha Levin Subject: [PATCH 4.9 027/111] ARM: exynos: Clear global variable on init error path Date: Mon, 24 Sep 2018 13:51:54 +0200 Message-Id: <20180924113107.217053027@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.337261320@linuxfoundation.org> References: <20180924113103.337261320@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Krzysztof Kozlowski [ Upstream commit cd4806911cee3901bc2b5eb95603cf1958720b57 ] 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 Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-exynos/suspend.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/arm/mach-exynos/suspend.c +++ b/arch/arm/mach-exynos/suspend.c @@ -252,6 +252,7 @@ static int __init exynos_pmu_irq_init(st NULL); if (!domain) { iounmap(pmu_base_addr); + pmu_base_addr = NULL; return -ENOMEM; }