Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp280402yba; Sat, 13 Apr 2019 00:24:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLl5l6WSzRQ3BMDcrkiB774hFFmsazdISqXT/ZZFgs8UML56kAe3qBTJbQpXiwOayHozCS X-Received: by 2002:a63:2c4c:: with SMTP id s73mr52678938pgs.42.1555140288486; Sat, 13 Apr 2019 00:24:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555140288; cv=none; d=google.com; s=arc-20160816; b=XJ9K1fNcxr0CZikadSa/gZIabRgvvNdyjpfQLlKAAXitEcQY6ipZUkKjwQ4CzUPEJN lXiEq6RS1olXGTL6t8eH6Drg3HIq1ksveGEvojE1U81P5YEmS7jrQMj+5C1ncYwEpr+q Dao8g3rtEqoLiyuZy1KQi1vbEtrt7ZbSJ8Gze5tmtKQAYj74d3+omI9wEvYEzK3hBA/p tYjsMcOnUQAgDGA+PZKwwwEEZUvEFED/hOVfBDVtzV+919e0uHPLA9UlXDdBfmkqsFGS LlTx15aOegr9zfP+uJxbnTYSemT6RkREH+fqXX6d8wH9s4FRqVrPGaKR4674ueRXwFuP NEAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=1X6Ynzq7cvlLrTH2V8hpQkXpoAFZNezi/PcHk5FiZuo=; b=OQbzEqAHG72WAnJb8zql0Nr0tvBaCQkE6kDPrw/3oO037efwK/X8h84aFBFfgYT/jH JtCMwvrOQYgxPrfSvmyXzK87TF13WlhOmh2zesE1DpBG4IZ7HPlszgvQGOdluDmeu4wM so49wbCtnjG7oKm6l8Qlk9fct7ynk/N/XcOhSDWoiR1+u7pRDUUekTx1zCGPEHaOWUbh PUFmALF44AwrsTrb0jch/ZTB6calY4oQRRXW+7QIexgErn6KxStDRB8cSs0GUuHBYzSN EAy7wqAdsetdnlKl1WqRLZu7mVxMG1u9jMbyw102TDoPQ1TIFYVG5m7g9vO939V6US4E DaMA== 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 j91si5603344pld.199.2019.04.13.00.24.32; Sat, 13 Apr 2019 00:24:48 -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 S1727352AbfDMHVq (ORCPT + 99 others); Sat, 13 Apr 2019 03:21:46 -0400 Received: from www.osadl.org ([62.245.132.105]:36453 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726953AbfDMHVp (ORCPT ); Sat, 13 Apr 2019 03:21:45 -0400 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 x3D7JfAS003435; Sat, 13 Apr 2019 09:20:03 +0200 From: Nicholas Mc Guire To: Russell King Cc: Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Mark Brown , Linus Walleij , Tony Lindgren , Mike Rapoport , Janusz Krzysztofik , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Nicholas Mc Guire Subject: [PATCH] ARM: imx: flag failure of of_iomap Date: Sat, 13 Apr 2019 09:14:16 +0200 Message-Id: <1555139666-948-5-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-Spam-Status: No, score=-1.9 required=6.0 tests=BAYES_00,DATE_IN_FUTURE_96_Q, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on www.osadl.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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); } } -- 2.1.4