Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3260056rwb; Mon, 15 Aug 2022 22:34:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR62nyb1PG8ZIynKG6pQWjq4zwCb8Y1Vfdd5ApKYghDor1CnCH2apcLSbCDQgZgugFR7GKfz X-Received: by 2002:a17:90b:4c4b:b0:1f4:d176:aa5a with SMTP id np11-20020a17090b4c4b00b001f4d176aa5amr21814396pjb.233.1660628054265; Mon, 15 Aug 2022 22:34:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660628054; cv=none; d=google.com; s=arc-20160816; b=ZbE6s9Niw5adcVyjfTMq6zYN9alH+S3yGFo7Jb5+pOElKGs9J9x32ct2qpvUgIx4Q7 Vp/t2zIgRYpKfZMSuZYMpX4L7Al159UjbdSzRPdNrKwNpJDWiDj4rMUC9VeBOCfWpOZl XtYqflao0/45OfCRU60TyAvFWjoDgpmBSl9UgicD27zko1FM0Z40jddYxBO8QQD3FsKY T9m60m4VEuRc8bKFoclZ8kcDctGXOE1NKd3U69VTsVMGG3+sl/+XW6f3pNiJUeuCJS4I NsTKbBJyeHLqtWi5VO8E3KyOVKOJ7qfl63nA8eBGouM5N1smT0R1llqYVpQ5DQ6L8MK5 UleA== 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=BcdxYujadkESipuGH8BbUrkD8o0lFwd3ShXD5hxf93muHAM9qrvH2JwF1AZQjapHTK 16OXsuiy0Jjgi2MDaOkLriesLEGvznzNbmDIzOdDapBHSz6qpzSif02M1PluHOR3+aBU kGjwKGIoP2vt8as71oIbfsVcWeVGMRXNzp8Wqa6hrloAQk3M9tJM1LMYVjTtFMyTfMF1 dcppuujy0zwEkVFzVpmK1KZ2zMd/PCquYBhcM/YqN3VHNO+5xDR4F1BePotqqyZ3yRv8 AE8h01y4uOiQnX6zXkcMiyXrcAi83wO2RZarLlyaSyPaEMzfAoIcoiToCBQ7fS6l/iit UzXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZUUvJEWu; 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 o21-20020a056a0015d500b0052e30022678si14177000pfu.3.2022.08.15.22.34.03; Mon, 15 Aug 2022 22:34:14 -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=ZUUvJEWu; 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 S232895AbiHPEsj (ORCPT + 99 others); Tue, 16 Aug 2022 00:48:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232617AbiHPEpn (ORCPT ); Tue, 16 Aug 2022 00:45:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 485C9AE9C0; Mon, 15 Aug 2022 13:42:27 -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 D794E61238; Mon, 15 Aug 2022 20:42:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C596BC433C1; Mon, 15 Aug 2022 20:42:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596146; bh=sZQQJBhKBqZz1oQBCZX4pRulQOQ09eGmJoa2eOxyBZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZUUvJEWuOyKgmBWmqZWca63QPFLI+iYQMsWQ5m/P/TBcz4wlqkwiFtPnMZGRase4l v4Q2UVX7WV70/R49vuOJ4rrwGdhycKfQcHnxVP3bGeoH3L2aKrhoQVDsuEZnalLUjZ cmeUWVryDqPG+3ySv32H5zBbqiJGhqkUIS/4fjRM= 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.19 0988/1157] watchdog: armada_37xx_wdt: check the return value of devm_ioremap() in armada_37xx_wdt_probe() Date: Mon, 15 Aug 2022 20:05:44 +0200 Message-Id: <20220815180519.259905079@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 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