Message ID | 1555139666-948-7-git-send-email-hofrat@osadl.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> 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 203691515 for <patchwork-linux-arm@patchwork.kernel.org>; Sat, 13 Apr 2019 07:22:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0A8028E89 for <patchwork-linux-arm@patchwork.kernel.org>; Sat, 13 Apr 2019 07:22:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4AAE28E91; Sat, 13 Apr 2019 07:22:53 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 9A5A028E89 for <patchwork-linux-arm@patchwork.kernel.org>; Sat, 13 Apr 2019 07:22:53 +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:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=MN+Hfn0yrsAJutY7yD2iFYmTifsoUt/HeDLqLOGu3sI=; b=mG97LG2rrAeGIfp2r7hEFlR/0j 56EtKi1vLR8VHqVNki/kRmoNkHCvt82XubK9juZeaYHK5oFljLjAYyc5i+MFohUjoi5tI6iX/fSVX 7xX0uHsOtn+awh2jQs7ABy2kO9BVyQAdgV/A5Ygo/40NW8P0iE/waOkkmdPjb8pnmVvOhyNKxFYn5 Px96Niht/P6U6tssSDzVQQsfgB39+U3SRq53yWYCMX8Q6W6I/BBjvgT60ZUc/4173HzXd9745ruOK syseKBmLeLP1SMj+kujeHHdClAjxNnwEzKBJ52V2s6pL2HekejNJX+NHtt/LaJ7PZaH04xJEmRove 7h6Xg92Q==; 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 1hFCzu-0005wq-M2; Sat, 13 Apr 2019 07:22:46 +0000 Received: from www.osadl.org ([2001:a60:9266:ffff:62:245:132:105]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hFCyi-0004Wp-PL for linux-arm-kernel@lists.infradead.org; Sat, 13 Apr 2019 07:21:44 +0000 Received: from debian01.hofrr.at (178.115.242.59.static.drei.at [178.115.242.59]) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id x3D7JfAU003435; Sat, 13 Apr 2019 09:20:14 +0200 From: Nicholas Mc Guire <hofrat@osadl.org> To: Russell King <linux@armlinux.org.uk> Subject: [PATCH] ARM: STi: at least warn if of_iomap fails Date: Sat, 13 Apr 2019 09:14:18 +0200 Message-Id: <1555139666-948-7-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1555139666-948-1-git-send-email-hofrat@osadl.org> References: <1555139666-948-1-git-send-email-hofrat@osadl.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190413_002133_234931_9A62B80A X-CRM114-Status: GOOD ( 10.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>, Tony Lindgren <tony@atomide.com>, Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, Janusz Krzysztofik <jmkrzyszt@gmail.com>, linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>, NXP Linux Team <linux-imx@nxp.com>, Pengutronix Kernel Team <kernel@pengutronix.de>, Nicholas Mc Guire <hofrat@osadl.org>, Fabio Estevam <festevam@gmail.com>, Linus Walleij <linus.walleij@linaro.org>, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
ARM: STi: at least warn if of_iomap fails
|
expand
|
diff --git a/arch/arm/mach-sti/platsmp.c b/arch/arm/mach-sti/platsmp.c index 231f19e..89ae76f 100644 --- a/arch/arm/mach-sti/platsmp.c +++ b/arch/arm/mach-sti/platsmp.c @@ -109,6 +109,7 @@ static void __init sti_smp_prepare_cpus(unsigned int max_cpus) if (np) { scu_base = of_iomap(np, 0); + WARN_ON(!scu_base); scu_enable(scu_base); of_node_put(np); }
The call to of_iomap() is unchecked but scu_enable(), which the returned address is passed on to, assumes a valid mapping. If the mapping is invalid this could probably lead to undefined system state so at least a warning should be issued. Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Fixes: commit 65ebcc115889 ("ARM: sti: Add STiH415 SOC support") --- Problem was found by an experimental coccinelle script Patch was compile tested with: multi_v7_defconfig (implies CONFIG_ARCH_STI=y, CONFIG_SMP=y) Patch is against 4.18-rc3 (localversion-next is next-20180712) arch/arm/mach-sti/platsmp.c | 1 + 1 file changed, 1 insertion(+)