Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp364683imi; Fri, 22 Jul 2022 00:17:26 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vDilxStmpJl0W1DSGAcnzX3TKpYt+CQQlAHPlfEKuW1xDcH2PS+mam/Pf0oBX8nBNjsxxl X-Received: by 2002:a65:6714:0:b0:41a:49fa:2bd7 with SMTP id u20-20020a656714000000b0041a49fa2bd7mr2005611pgf.331.1658474245863; Fri, 22 Jul 2022 00:17:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658474245; cv=none; d=google.com; s=arc-20160816; b=KMy2sXtPKkSr80CzLk4PxH5W12IMOhy4arwMhJDqNz5GQuxm1I+U0+EmTIvVbB2Y1H wFi2vGpmPySBeSL7pjOdBoMM7lXLXMMHRFB6WG6sYlFf6N+5kR39b5+qzcOm4fB56LEL xLHSN6/nBvxBVa26pYn81Sm0umlLWJZ9Uoo7adTy6BfLolH2jSL7wm3IrCSeUoKqlEv7 bpdBNa+e0hcZIefLIYbnmwB5dpkzLAMltqSi+z7tamwJx1MgCC275zXh540B/Em54Ixj BJU6KrclhRptkjrOclkacxzvWDUS1t4Yp7AQ/QMoo1GgRNc2+ozOAXLMl5wjZQoQ6f1R pu/A== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=mm4Os0hKw3ZVuX/tJ/YvBc6DO5qxAgqqfQRZ0cLsuzU=; b=Ydp8/tR0RUrbviZweTdkmRnNkAkrZ0euuj87tT3VH0R8lgYKXww4b1uaF2AbNe+WY0 IzdSK1Ekdq42+Sx+ee5uC59LKex7S+TwCNxiZGszv+aIQk8RKMTVMpqxKy4HJ5BtSN3Q jWVVMdbi2S5xBQbLop1yAY6Jc2CAhKiPYfD9aE750ksPk2Wq6nPq4rAlGptq+O31oNYx kIZ4Efm85MEXnzkZsSAODdPYMHtd/i7UoZupw8qhXbtcMPJ8CwsqcHhhVOSAjvyIzW2X ZyuTCHQwzQMG33ioccB4hc/s+ih4eH/3kmWWNzAgZjEsqy8GoeUT4LiB3LJnNYzZdllt DW1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dquxBBUX; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z7-20020a170903018700b0016d11815809si6268889plg.460.2022.07.22.00.17.10; Fri, 22 Jul 2022 00:17:25 -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=@kernel.org header.s=k20201202 header.b=dquxBBUX; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234589AbiGVHQZ (ORCPT + 99 others); Fri, 22 Jul 2022 03:16:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234577AbiGVHPV (ORCPT ); Fri, 22 Jul 2022 03:15:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C43B99643; Fri, 22 Jul 2022 00:14:37 -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 E782662188; Fri, 22 Jul 2022 07:14:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCFFAC341C7; Fri, 22 Jul 2022 07:14:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658474076; bh=69P75Uh9tSzboiEnDeDePBKG/ovLsyPxSOwg4CcKbQs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dquxBBUXTymrJ56KloIC8oQr43PApoKh8fqGRem/LXrDlcPQV23c+nQ9jmKbPCgax NiFnFwcba6azEZo7HdBIoJp86AeKZCJe5KW1gc+AZ3bIoX61az7+9AWYsUdOxugpUv z7Fyn+MG66/aJ0UrGmR4JezoigO5obPFHbOH9g1bonzKsanwuIqtRnSt87KqGohUg5 UFOjstoL5SvwY8otKrYWQp3CxnXgkOv2Lm02jARLn9JzzzhD4FOVNMtdNlV3mOtqOc k6bgVf27WOHflCU0Pn6SELNR9eQkTZI8DgpB+sJwf1ZVE2Y7IxDcDV66M5XSdrlshG 6FHBmxHPwhv5w== Date: Fri, 22 Jul 2022 09:14:31 +0200 From: Marek =?UTF-8?B?QmVow7pu?= To: williamsukatube@163.com Cc: wim@linux-watchdog.org, linux@roeck-us.net, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, William Dean , Hacash Robot Subject: Re: [PATCH] watchdog: armada_37xx_wdt: check the return value of devm_ioremap() in armada_37xx_wdt_probe() Message-ID: <20220722091431.1572e92c@dellmb> In-Reply-To: <20220722030938.2925156-1-williamsukatube@163.com> References: <20220722030938.2925156-1-williamsukatube@163.com> X-Mailer: Claws Mail 3.19.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.8 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 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 On Fri, 22 Jul 2022 11:09:38 +0800 williamsukatube@163.com wrote: > From: William Dean >=20 > The function devm_ioremap() in armada_37xx_wdt_probe() can fail, so > its return value should be checked. >=20 > Fixes: 54e3d9b518c8a ("watchdog: Add support for Armada 37xx CPU watchdog= ") > Reported-by: Hacash Robot > Signed-off-by: William Dean > --- > drivers/watchdog/armada_37xx_wdt.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > 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_devi= ce *pdev) > if (!res) > return -ENODEV; > dev->reg =3D devm_ioremap(&pdev->dev, res->start, resource_size(res)); > + if (!dev->reg) > + return -ENOMEM; > =20 > /* init clock */ > dev->clk =3D devm_clk_get(&pdev->dev, NULL); Reviewed-by: Marek Beh=C3=BAn