From patchwork Sun Jul 8 08:32:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Mc Guire X-Patchwork-Id: 940915 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=osadl.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="iR7Vrq+U"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41NhfT0nxQz9s29 for ; Sun, 8 Jul 2018 18:37:20 +1000 (AEST) 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: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:In-Reply-To: References:List-Owner; bh=Vh899N75FDFMBy3rudCLi86kY1Ds8/IvjQqatk25kzw=; b=iR7 Vrq+Uyplw9Qoy4GXwXNSyr6T6DC+vDWkEnp9WSv46L5U5oexY4Zns1ny4VSVqy/9KeasyjvQ8nQd3 CbA7G4XjXcEI/q1roLVsbi2NZHWj/pxRixslcC94EmtoGHcE7jQiq9G7xLwP/iAMkXZ3bNSwXILxf maGMa7h3bsyfJnjrs1R3Iqd1phKQyj6cjuFuYOzROKZLr+W0IPuWp3qh/pl6qci1BYpboc39+EWuu fRi8NyAKXGNZpyTLt3mDYL3GXKgotqN9n2jAO0Zucd+i1O9hPPFE4RmZIZPxnq88S16t6H5eC2BdS Ohv2a8QHu87xWy04F02i05+YfFC7Bog==; 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 1fc5Bx-00024s-F1; Sun, 08 Jul 2018 08:37:13 +0000 Received: from www.osadl.org ([62.245.132.105]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fc5Bt-00023v-6b for linux-arm-kernel@lists.infradead.org; Sun, 08 Jul 2018 08:37:11 +0000 Received: from debian01.hofrr.at (178.115.242.59.static.drei.at [178.115.242.59] (may be forged)) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id w688XYPe029791; Sun, 8 Jul 2018 10:33:35 +0200 From: Nicholas Mc Guire To: Steffen Trumtrar Subject: [PATCH] ARM: imx: flag failure of of_iomap Date: Sun, 8 Jul 2018 10:32:54 +0200 Message-Id: <1531038774-24657-1-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 2.1.4 X-Spam-Status: No, score=-1.9 required=6.0 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on www.osadl.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180708_013709_542450_4D5451AF X-CRM114-Status: GOOD ( 10.19 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [62.245.132.105 listed in list.dnswl.org] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sascha Hauer , Russell King , linux-kernel@vger.kernel.org, NXP Linux Team , Pengutronix Kernel Team , Nicholas Mc Guire , Fabio Estevam , Shawn Guo , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org imx_set_aips is assuming that the address returned from of_iomap is valid which it probably is in the normal case - as the call site is void error propagation is not possible but never the less at least a WARN_ON() seems warranted here. Signed-off-by: Nicholas Mc Guire Fixes: commit e57e4ab5fc2e ("ARM: i.MX: allow disabling supervisor protect via DT") --- Problem found by experimental coccinelle script Patch was compiletested with: multi_v7_defconfig Patch is against 4.18-rc3 (localversion-next is next-20180706) arch/arm/mach-imx/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c index 32969f3..c6b1bf9 100644 --- a/arch/arm/mach-imx/cpu.c +++ b/arch/arm/mach-imx/cpu.c @@ -68,6 +68,7 @@ void __init imx_aips_allow_unprivileged_access( for_each_compatible_node(np, NULL, compat) { aips_base_addr = of_iomap(np, 0); + WARN_ON(!aips_base_addr); imx_set_aips(aips_base_addr); } }