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: 6104911 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B9D01BF90F for ; Fri, 27 Mar 2015 10:44:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E3667203B7 for ; Fri, 27 Mar 2015 10:44:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 02AB12041B for ; Fri, 27 Mar 2015 10:44:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752275AbbC0KoI (ORCPT ); Fri, 27 Mar 2015 06:44:08 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:18992 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752200AbbC0KoG (ORCPT ); Fri, 27 Mar 2015 06:44:06 -0400 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>; 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 Cc: Arnd Bergmann , Olof Johansson , Marek Szyprowski , Krzysztof Kozlowski 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 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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;