Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp1367253imi; Sat, 23 Jul 2022 03:50:58 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vdaitzrIqZNVHq3ayiaD5grOQPYM4MqE8DzOgm32yBn3sB4l7oMDHe21vyyrU3Wggl9sxo X-Received: by 2002:a17:90b:33d2:b0:1f0:3a40:982d with SMTP id lk18-20020a17090b33d200b001f03a40982dmr4381060pjb.60.1658573457777; Sat, 23 Jul 2022 03:50:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658573457; cv=none; d=google.com; s=arc-20160816; b=R34WBBEt6+mUxgO2qQIXvgCpVMlkJ87StdomNilr3cIQOtZwd3i8kUFFs+vDYHdmxu kHCJkUXVeuOIg0V7sn7hzHCoOEuQ7MFQv3X38vlbQXwHoyQd6rOE9y0lEdpv0rPdYLZ2 nNU1P5ERiMFt/nKuktBjJetytyha/e3tISs2JaCKjH1+lnA61vM8mz5OYxY4c1vnEhgH 7/zB0vymC/XTetu0b3thWEm0ix7+1JTNW8UrW0xBxLAuiiZ46Jb+oZVp54PwdLwF21Ep 5136M9imT1ttWkbL/9R7C/i5XMhhjs2GWvgviXl336p3Gvc3SbYI2E7RFNAf8Iysj1jc bbrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=wM/ZgeEXEMc6sruVtkovWHuCByrjUkw3xuMCX7v3yss=; b=cxRFoZtGhn1A5u2KQewE6X14/8BxMaOIjBAK60GETdbe4mdR/SPvBySd/TAcbXYP9O Lt+YJ4FeaR1ELMsi6ILCJYF9a2scHubTXaLobWVal1ynrkUElJsOVrihUK+AIBsjyrzw vglzOxVcsKSVJ/V3k3A7EIFKuXt0U6I7K0dFCAVt6fBKOEpdGNwl7h0ZHv3FAdnbEvf1 hyeXTPIPeGueciDyb67g/Z6b4Cd9h3SeuBApgEzUSrwZ0/D8Zn4SmlNLykXsMcT84+cj IPXpxAqXpyqCcIndQGl//si1/dtSMr44KtOkeKFxfIzIMFkMMjONIyFsp49F13kwcvjn zFzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=jkZjnVug; 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=163.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i2-20020a170902eb4200b0016d26c13a87si7773952pli.525.2022.07.23.03.50.43; Sat, 23 Jul 2022 03:50:57 -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=@163.com header.s=s110527 header.b=jkZjnVug; 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=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239040AbiGWKNB (ORCPT + 99 others); Sat, 23 Jul 2022 06:13:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239039AbiGWKMn (ORCPT ); Sat, 23 Jul 2022 06:12:43 -0400 Received: from m12-18.163.com (m12-18.163.com [220.181.12.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0DF3AD2C31; Sat, 23 Jul 2022 03:03:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=wM/Zg eEXEMc6sruVtkovWHuCByrjUkw3xuMCX7v3yss=; b=jkZjnVugzhSTujONx6O3N HnOg1JCy6HNrRztipMFB5cUHCDJpOspJut8zeGWoqcOOAUEgtXW8mAQcLYOd6WWZ DZOEbuDwDcnSMRNRPkcE9GrIQT8YyZ96OquD0wT+75ukSj5UWZHhib1CYTFvvxSt uOiX/ZAJoxT12UkSSrvOn0= Received: from localhost.localdomain (unknown [123.58.221.99]) by smtp14 (Coremail) with SMTP id EsCowADHB9T8xttiEWurOg--.13020S2; Sat, 23 Jul 2022 18:01:35 +0800 (CST) From: williamsukatube@163.com To: tglx@linutronix.de, maz@kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Cc: tsbogend@alpha.franken.de, fancer.lancer@gmail.com, William Dean , Hacash Robot Subject: [PATCH v2] irqchip: mips-gic: check the return value of ioremap() in gic_of_init() Date: Sat, 23 Jul 2022 18:01:28 +0800 Message-Id: <20220723100128.2964304-1-williamsukatube@163.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: EsCowADHB9T8xttiEWurOg--.13020S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrtry5tr13GF1rZrWruFy3Arb_yoWfuFbE93 WqgFZ3AFW0vF18GFW7WFW7XFyUJwn7uFn5urWkta4fXrWfuw4xGr9xuwn8Xa4rXF1Iyr98 CFZ5ZryIyF17AjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU8Jrc3UUUUU== X-Originating-IP: [123.58.221.99] X-CM-SenderInfo: xzlozx5dpv3yxdwxuvi6rwjhhfrp/1tbiUQlHg2DEOr2dEAABsz X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 From: William Dean The function ioremap() in gic_of_init() can fail, so its return value should be checked. Reported-by: Hacash Robot Signed-off-by: William Dean --- v2: delete fixes tag and correct SoB tag 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); -- 2.25.1