Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3023605rwb; Mon, 15 Aug 2022 16:21:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR6SzW9feX/kB3smy6EsVGtszteYroGTcJAbRjTSWE5sPPzE33pcr20MwSY21k0yd2FuaeKW X-Received: by 2002:a17:907:7d8f:b0:732:9d6c:4373 with SMTP id oz15-20020a1709077d8f00b007329d6c4373mr11232918ejc.493.1660605671653; Mon, 15 Aug 2022 16:21:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605671; cv=none; d=google.com; s=arc-20160816; b=WnvM+eCqk0r66qVBl0UQnvHVdi3nXwOWpedQWphjwo8G/8nuO9LnTUb5CxK/qeJzsM I1PcU0nPwG/wMtaIMl9gvKHj/ub5Vbz71syzNTky5fTIwiWp3PHfJIksPzJEVdZG0kLE gNrliTquU+OLTOE+SXu0bt6NkOflHXNuEFAbwAX75G6gSPLZHriY1H9sNMGi0HKvsN7H x7BPJC6me6nSaqIjOaI0HyvggBoj4NmItqABUIDERDYGDyE+lT5JOICdfQjIf31UBi+r oq76IDLJu2JLGzoPl2BuoDvgjtvKqOFZjtd/FrxPBuQmH0p7bv5A4tCgdMrerEO4N9Ae UhaQ== 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=QfI4kqRUW5Q6l2ciu5uvIA8byWxIT9tRvqzwsMkCvx9gLuYq7AnXUykOULhQNgkinG 7qeES9VA5giP0IvgWXwBJEIQFrfrhApXJ9qUqu/gBlqteKaI+pE4u1pxsp3JmZsMmSB7 1fqUbJzUG9P1h4n6ekTWKYb1q4BcpfcOpn3cz2Lxrf7qibTuHKk8LrPhcRktVCgNA3ck PMKO1Qod89dfUF0uC/rk6HozcRRrs+J6WjoSAclA5+EH1fVYtPiMa0lNkdYkUf0SEvRA 9xqn3fY0amMYcRFxZtTl+VOs5UnJOgWrlG7FRnEH+Fk9W158Ct9BrQdaF4MWclMqTsA/ gAtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="WR9/5JmH"; 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 k6-20020a170906158600b00733069541b8si7392725ejd.102.2022.08.15.16.20.46; Mon, 15 Aug 2022 16:21:11 -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="WR9/5JmH"; 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 S1351899AbiHOWtn (ORCPT + 99 others); Mon, 15 Aug 2022 18:49:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352039AbiHOWrl (ORCPT ); Mon, 15 Aug 2022 18:47:41 -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 D3C26135AC9; Mon, 15 Aug 2022 12:53:17 -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 3BA9160FB9; Mon, 15 Aug 2022 19:53:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2549DC433C1; Mon, 15 Aug 2022 19:53:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593196; bh=sZQQJBhKBqZz1oQBCZX4pRulQOQ09eGmJoa2eOxyBZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WR9/5JmHNqP6g8X17EK5on5n0Gy71Ze8P2Q7hFNicPJLuYHUQImCEJWzYgs5uPHLj pURokytHyBUBMwK74t8XYYmSrMzenzhmOjf1yDk2kKlyH20tgFEoC5ABimzMFp53t7 u7r01ve0G9iGQU17hO+dG8zQlJiuYHu6icqGYvRU= 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.18 0910/1095] watchdog: armada_37xx_wdt: check the return value of devm_ioremap() in armada_37xx_wdt_probe() Date: Mon, 15 Aug 2022 20:05:09 +0200 Message-Id: <20220815180506.932605582@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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