Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp457449imi; Fri, 22 Jul 2022 02:48:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1snYzGB0VVlFI4qULRNK74swiMpwkx6TxwmBQC+ps7Af3Ua/2aLyfSYwsphGikHAxsB9G3t X-Received: by 2002:a17:902:8543:b0:16b:fbd1:9f68 with SMTP id d3-20020a170902854300b0016bfbd19f68mr2623351plo.101.1658483323787; Fri, 22 Jul 2022 02:48:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658483323; cv=none; d=google.com; s=arc-20160816; b=XnOYdCuU/npi4mco8iwZIpqEtTUbtASV+2K1x4tbn6gY8q4nep0G1SwtCJ0L+sj4fl EgsjKHaTlltRwQIqyCvuAH52HASWRmX/6umedBZ9t8peD517BmkNRg2XJsUg8uTHIVOj nHn98HDK2HUtWifQULSm0OwXmVRtQRns85iBDMuOCXujVl1dRzQmoUF9pm04XpUaQfeC O2q2dYbFXe/qCF7Zuz0ia8zLhmVjXDNRsSbJOdRdaATRyXuT6axZjs1m893gObQFw+b5 YMZdCn1IarJzBgkqcPRsddXdA/QxR2x3/Yu3nnhaZVi/NuwkvFEYoPDIkxdC/AwKv1Cb jHjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=QLgKZ/E4TdwWfCPs0RpIhrz9wRJyN7GvwWLH4OqYd8U=; b=YJoH4foPjK+hdZ35kwUnmoXCyw4Bw1OJRc51+2DMuFJaO0dW18LJ/3K4DGBmq2Uaz4 8gp7DOT2ucrErSqECQhUqIX3LRMb2nuNo2B3ymOW534Q6O3tOXvIMZnqAepOwX+MPbzW 5rPutL/RSvBjViXsWVpxmwlGFimiol45ywj3DiUOVUYTmy+Luvb6Nez7HnyTe/bc8aKF CGLuHGmSt7q1xXmVNk2wVEMdyggYBMBBxYg6DkCIQ0I3AgnfbqUewSfGw9U9+RccdTBk YpWJW0SrHWUYqO7xDoVqnbftV6hxaPzZqFf1dwRbWN0KsrDIlEqiWyUnNJ3WxVho7V0z oWTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EWruO1UO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m11-20020a634c4b000000b003fe2bc67bbdsi5052776pgl.116.2022.07.22.02.48.29; Fri, 22 Jul 2022 02:48:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EWruO1UO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236086AbiGVJdH (ORCPT + 99 others); Fri, 22 Jul 2022 05:33:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236203AbiGVJcp (ORCPT ); Fri, 22 Jul 2022 05:32:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66E45BB8F9; Fri, 22 Jul 2022 02:21:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A827461F84; Fri, 22 Jul 2022 09:21:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 184D8C341C6; Fri, 22 Jul 2022 09:21:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658481690; bh=+kLz+9I3CzRyBr/p3N3DpSDgxlfeXpQnryZXRa3g5iA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=EWruO1UOu79Eul2pZU0BWcZugZRvcm26bIFPyMC6FpsIJVMiHqjtx58bFKLEVhlbq eTdXTGnBG3Un/vkuISRd5nmKXcO3tRW/irFoQagEJGtnDIKRcayRmVvihuZMpdLPxa ll0RWs09RsMxi1ulxkwWFEu5eFFMd1dZadMA9TTXaWxW299+Yo+kutKU9omhfSjKSA Wido05A6D/CX+qOiDXk3XytfA9bUE2P7Brm1/c9CKafuEuOiyvHh4FzzuXebfxb6+y 294I0YdlWVQL+ozrB+LSYccwLqmiIlyEP75YjfnD8d2SMk/auLRkLsEVRukr0Frq7R ADciHZoGYwr6g== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oEoqb-009Ibw-Uc; Fri, 22 Jul 2022 10:21:27 +0100 Date: Fri, 22 Jul 2022 10:21:25 +0100 Message-ID: <87mtd1y02y.wl-maz@kernel.org> From: Marc Zyngier To: williamsukatube@163.com Cc: tglx@linutronix.de, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, tsbogend@alpha.franken.de, fancer.lancer@gmail.com, William Dean , Hacash Robot Subject: Re: [PATCH] irqchip: mips-gic: check the return value of ioremap() in gic_of_init() In-Reply-To: <20220722091008.2937238-1-williamsukatube@163.com> References: <20220722091008.2937238-1-williamsukatube@163.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: williamsukatube@163.com, tglx@linutronix.de, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, tsbogend@alpha.franken.de, fancer.lancer@gmail.com, williamsukatube@gmail.com, hacashRobot@santino.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 22 Jul 2022 10:10:08 +0100, williamsukatube@163.com wrote: > > From: William Dean > > The function ioremap() in gic_of_init() can fail, so > its return value should be checked. > > Fixes: 4bdc0d676a643 ("remove ioremap_nocache and devm_ioremap_nocache") Erm... No. The issue was definitely there before (just look at the patch you quote here). > Reported-by: Hacash Robot > Signed-off-by: William Dean If sending from a different address, please add a SoB that matches the address you are using. > --- > drivers/irqchip/irq-mips-gic.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c > index ff89b36267dd..a1f6d955794a 100644 > --- a/drivers/irqchip/irq-mips-gic.c > +++ b/drivers/irqchip/irq-mips-gic.c > @@ -734,6 +734,10 @@ static int __init gic_of_init(struct device_node *node, > } > > mips_gic_base = ioremap(gic_base, gic_len); > + if (!mips_gic_base) { > + pr_err("Failed to ioremap gic_base\n"); > + return -ENOMEM; > + } > > gicconfig = read_gic_config(); > gic_shared_intrs = FIELD_GET(GIC_CONFIG_NUMINTERRUPTS, gicconfig); Thanks, M. -- Without deviation from the norm, progress is not possible.