From patchwork Fri Mar 27 10:43:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 6104971 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C1AC29F2A9 for ; Fri, 27 Mar 2015 10:47:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E7563203B7 for ; Fri, 27 Mar 2015 10:47:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0D58D203A4 for ; Fri, 27 Mar 2015 10:47:10 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YbRl6-0006KL-1j; Fri, 27 Mar 2015 10:45:00 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YbRkc-0005rS-VG for linux-arm-kernel@lists.infradead.org; Fri, 27 Mar 2015 10:44:31 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NLV00FGCA0AGL40@mailout1.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 27 Mar 2015 10:48:10 +0000 (GMT) X-AuditID: cbfec7f5-b7fc86d0000066b7-94-5515347395fe Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 62.CC.26295.37435155; Fri, 27 Mar 2015 10:44:03 +0000 (GMT) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NLV00AVR9TCWG50@eusync2.samsung.com>; Fri, 27 Mar 2015 10:44:04 +0000 (GMT) From: Krzysztof Kozlowski To: Kukjin Kim , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH 1/2] ARM: EXYNOS: Handle of of_iomap() failure Date: Fri, 27 Mar 2015 11:43:55 +0100 Message-id: <1427453036-6808-1-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrOJMWRmVeSWpSXmKPExsVy+t/xK7rFJqKhBi8blSz+TjrGbvH6haFF /+PXzBabHl9jtbi8aw6bxYzz+5gs1h65y25x6vpnNgcOj9+/JjF6bFrVyeaxeUm9x5UTTawe fVtWMXp83iQXwBbFZZOSmpNZllqkb5fAlfH8wkPmglb2ikdzpzI3MH5g7WLk5JAQMJHYeW8j C4QtJnHh3nq2LkYuDiGBpYwSz368ZYVw+pgkXl9+C1bFJmAssXn5ErAqEYEuRolZW36zgSSY BRYxSiy56AxiCwu4Stx5egksziKgKtH6p5kZxOYVcJO4uPsh1Do5iZPHJrNOYORewMiwilE0 tTS5oDgpPddIrzgxt7g0L10vOT93EyMkcL7uYFx6zOoQowAHoxIPL2e9SKgQa2JZcWXuIUYJ DmYlEd6Vj4FCvCmJlVWpRfnxRaU5qcWHGJk4OKUaGJ22XbN6fmin/PL2z2lC/5jeOoeEBZmW z6126jr+KMNAVLV5rfytMutlfkF82TXy+9jPBDxmn3hrsc19g/y+v1bfLgnx5jYc+JAQVC7d Lbh2/9sLXbnKuRcNHzu+dFrvbD1ZIPjOxktcLO92ns85u/m9QXVjHHvYUjHlcoG3326yvGFj TT3xQYmlOCPRUIu5qDgRACpeDZj6AQAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150327_034431_197271_BD8C7DD0 X-CRM114-Status: UNSURE ( 6.93 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.0 (-----) Cc: Olof Johansson , Krzysztof Kozlowski , Arnd Bergmann , Marek Szyprowski X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Prevent possible NULL pointer dereference if of_iomap() fails. Handle the error by skipping such power domain. Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-exynos/pm_domains.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c index cbe56b35aea0..2c5c206f3ea9 100644 --- a/arch/arm/mach-exynos/pm_domains.c +++ b/arch/arm/mach-exynos/pm_domains.c @@ -138,6 +138,13 @@ static __init int exynos4_pm_init_power_domain(void) pd->pd.name = kstrdup(dev_name(dev), GFP_KERNEL); pd->name = pd->pd.name; pd->base = of_iomap(np, 0); + if (!pd->base) { + dev_warn(&pdev->dev, "Failed to map memory\n"); + kfree(pd); + of_node_put(np); + continue; + } + pd->pd.power_off = exynos_pd_power_off; pd->pd.power_on = exynos_pd_power_on;