Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3013706rwb; Mon, 15 Aug 2022 16:09:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR4OmXZ1YhIObZmKcsJeaG4EpxUvMdz5LSBD1lhDooX6weHR7lwspAul0C3w38S+NbKtIndt X-Received: by 2002:aa7:cf13:0:b0:43d:603a:b736 with SMTP id a19-20020aa7cf13000000b0043d603ab736mr17116209edy.20.1660604968690; Mon, 15 Aug 2022 16:09:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660604968; cv=none; d=google.com; s=arc-20160816; b=ya1z0OSsrRgapp2NVBuz/+OeU2aF8YSNosvwm9Kp0EhM4JvjkSWDANAKpYS43I1VGU 3fv/ID6BXxWFTO8kVQJ2yt6Bmi55On5pphuTZvt41pdQou1TIYMOA0Z+Zp6iNtKZvXZh Xat+L6hAFqNXrFppHsGiWwcXUd/iyyycol76SUoVFkpbMvZiFstJD8ri6jXX0HqsWb9T o7AVCu1WixfLDGTW9YPcRGl8eCPuBNbCviyP+db6b+T/YN+Aj4FPbjSuTHixYtaSee6K h+23mqoUCvGgvz/s+w6zwu7SbnhXwoB9jsHyaoLpIi/gglMi0/2hZ0LrGwGb/4XgCTyP k3pw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aWnO6tI1GT4UG/c2FJF4h4sIuMa7YzKAsJ3uYmq+JRA=; b=hS+nl7+3WlebzEZeFC1t0k6X0YLQxaB8RV2KUHrvds17G2A5nPFNT/5C1/vxir7Av8 dnOvMoS6NdzADLaBEOaPpvnvRqRUz0XG4Ix3XeKUT9gN6svsZ8aim4yBBudX3rZK2Wd7 9mla6jE9QOUA7VXzy2QIH6pJeEgdtZrRACi49n+TAJoO+B7gsIfkOC+kfrNk9SuXJogz rTC/ANhz5JaZ/OBwuX1pIhfJIIklhuS62ubwkwFVCLzlKfPUq6slka7r1gtDTx6BCOcr jOqL7rrnxEKIeI7xN09qEzqU8Xstnog0d4ZJx6wx7KC8amVu31PfDbxohrHKkdzhx5ht k+NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XuJzCuD5; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nc15-20020a1709071c0f00b0072a72bb6f80si8876744ejc.744.2022.08.15.16.09.03; Mon, 15 Aug 2022 16:09:28 -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=@linuxfoundation.org header.s=korg header.b=XuJzCuD5; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231508AbiHOWdm (ORCPT + 99 others); Mon, 15 Aug 2022 18:33:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351027AbiHOW11 (ORCPT ); Mon, 15 Aug 2022 18:27:27 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68D2674B8C; Mon, 15 Aug 2022 12:46:14 -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 sin.source.kernel.org (Postfix) with ESMTPS id DA3D4CE1262; Mon, 15 Aug 2022 19:46:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD821C433D6; Mon, 15 Aug 2022 19:46:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660592771; bh=8FaatRZzs5J89s4nJSmm66AsNZkhJ2K5cP0SUBU4jF0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XuJzCuD5KuKe+MrQ5o9efc9LnfJ5b0l10iMev0NKwJXWEpzWLMYorhnrk8pKzs4ky XNyrxFr9tS8J0e0iLSDZPYYRCzkTvEHve3FgfDlqGDl63bn0QrgrgtHfL/DD4UMDuN zHDubwMQQExTw59oW3Dr7Paml173C7QHOGSy2upI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hacash Robot , William Dean , Marc Zyngier , Sasha Levin Subject: [PATCH 5.19 0162/1157] irqchip/mips-gic: Check the return value of ioremap() in gic_of_init() Date: Mon, 15 Aug 2022 19:51:58 +0200 Message-Id: <20220815180446.167919790@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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,T_SCC_BODY_TEXT_LINE 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 [ Upstream commit 71349cc85e5930dce78ed87084dee098eba24b59 ] 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 Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220723100128.2964304-1-williamsukatube@163.com Signed-off-by: Sasha Levin --- 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 8a9efb6ae587..1ba0f1555c80 100644 --- a/drivers/irqchip/irq-mips-gic.c +++ b/drivers/irqchip/irq-mips-gic.c @@ -783,6 +783,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.35.1