Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2879615rwb; Mon, 15 Aug 2022 13:10:53 -0700 (PDT) X-Google-Smtp-Source: AA6agR6T20BDBMhrqd3mY0L3Xd+Vs0JFUfu5LXEe9nDuehgGQMr3vxz9Il9w/vIvhKY/L/E4YpOg X-Received: by 2002:a17:907:3e93:b0:730:a92b:e7e1 with SMTP id hs19-20020a1709073e9300b00730a92be7e1mr11657817ejc.621.1660594253085; Mon, 15 Aug 2022 13:10:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594253; cv=none; d=google.com; s=arc-20160816; b=xf0Ni2ah52mjGkeOuEOG+Kt7Rs56SAsuxLX8z8JArrqWT5WMSXu6CtViCOv3zMelID Hwduzl5nyWdTcrc9UPCKydJDMOAWdDkKhYKLwgByGl3mWTGvXvZUbPX0lBAxkDLQPmob 5a3BRCjvLxozwCSitvtS4QZ43/wRobM//g6nGMPt1FOREOa3ny6UHyDnvxo3Uptw6eTZ OJo9GUnA3MLTUmjlxFQUINX9gaK/JaY04mj9n3UwhIzxEcud1Qb4QMNxI4TxbEAsK01s tz+bR8TMe/2P/7mt8YR/PJBCSZDMmKQSWmpaWeQNiCgIicJBwqIq1FjKLRGeS0e66aNF Xwog== 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=l6X7tW8QvYEn9QZifiPrruju9YL0RaVNt6LLgsYptGc=; b=UKmlb8p8nj5yXRXWqaDjvKE/hbrWg5REVvVCIQ4qWqH6IpTrBlu9gA4HMHejzjGt7u w/I5gJilq4WpR3+2u1ksWSFaEhAe7MkkpCSYcDXqVhLDWjX6u5M1tLTcn/D5RnauU19C hKzM1Rtbuppu4ldLV9WFMJQGkDRtLxN9GrF3pOq9lpUeDEv5gzxYuES26tNipmtwKKMz nsJ6EFOB1aZNDCr8I6Aipf6incDhZ8m22SQk+Mf86SjSRfaQcjQBgtAVFi204teiQrr5 Jkjgv1qK/8bz2AWyIoa7wZ0N0OTSMNEPGvO7jrtOEKPXFQh9NCEO6TO7gnFCBX45mdUm IDlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ppuSzYIH; 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 w9-20020a05640234c900b0043d62064bc8si9931810edc.231.2022.08.15.13.10.27; Mon, 15 Aug 2022 13:10:53 -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=ppuSzYIH; 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 S1344844AbiHOTpG (ORCPT + 99 others); Mon, 15 Aug 2022 15:45:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344919AbiHOTlz (ORCPT ); Mon, 15 Aug 2022 15:41:55 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76644419B7; Mon, 15 Aug 2022 11:47:42 -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 ams.source.kernel.org (Postfix) with ESMTPS id B276DB81057; Mon, 15 Aug 2022 18:47:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6205C433C1; Mon, 15 Aug 2022 18:47:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660589259; bh=sZQQJBhKBqZz1oQBCZX4pRulQOQ09eGmJoa2eOxyBZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ppuSzYIHh9nIy6RP/rEmORTihFSIT3oGSWZeyUnSZPwzHENZJ61kix/1N4G3w+NWX au2zlIe72mlYbxPA6FvzR/gmS3rkl3X2eT9IOvPVezPg0aFtpAYgFs7tNzEUQr//aA qIQskTGgqAoXFVyq8z3tkG0DD99NMCu4yvbEwSAw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hacash Robot , William Dean , Marek Beh=C3=BAn , Guenter Roeck , Wim Van Sebroeck , Sasha Levin Subject: [PATCH 5.15 631/779] watchdog: armada_37xx_wdt: check the return value of devm_ioremap() in armada_37xx_wdt_probe() Date: Mon, 15 Aug 2022 20:04:35 +0200 Message-Id: <20220815180404.315501255@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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 2d27e52841092e5831dd41f313028c668d816eb0 ] The function devm_ioremap() in armada_37xx_wdt_probe() can fail, so its return value should be checked. Fixes: 54e3d9b518c8a ("watchdog: Add support for Armada 37xx CPU watchdog") Reported-by: Hacash Robot Signed-off-by: William Dean Reviewed-by: Marek Beh=C3=BAn Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220722030938.2925156-1-williamsukatube@163.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck Signed-off-by: Sasha Levin --- drivers/watchdog/armada_37xx_wdt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/watchdog/armada_37xx_wdt.c b/drivers/watchdog/armada_37xx_wdt.c index 1635f421ef2c..854b1cc723cb 100644 --- a/drivers/watchdog/armada_37xx_wdt.c +++ b/drivers/watchdog/armada_37xx_wdt.c @@ -274,6 +274,8 @@ static int armada_37xx_wdt_probe(struct platform_device *pdev) if (!res) return -ENODEV; dev->reg = devm_ioremap(&pdev->dev, res->start, resource_size(res)); + if (!dev->reg) + return -ENOMEM; /* init clock */ dev->clk = devm_clk_get(&pdev->dev, NULL); -- 2.35.1