All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marek Behún" <kabel@kernel.org>
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 <williamsukatube@gmail.com>,
	Hacash Robot <hacashRobot@santino.com>
Subject: Re: [PATCH] watchdog: armada_37xx_wdt: check the return value of devm_ioremap() in armada_37xx_wdt_probe()
Date: Fri, 22 Jul 2022 09:14:31 +0200	[thread overview]
Message-ID: <20220722091431.1572e92c@dellmb> (raw)
In-Reply-To: <20220722030938.2925156-1-williamsukatube@163.com>

On Fri, 22 Jul 2022 11:09:38 +0800
williamsukatube@163.com wrote:

> From: William Dean <williamsukatube@gmail.com>
> 
> 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 <hacashRobot@santino.com>
> Signed-off-by: William Dean <williamsukatube@gmail.com>
> ---
>  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);

Reviewed-by: Marek Behún <kabel@kernel.org>

      parent reply	other threads:[~2022-07-22  7:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-22  3:09 [PATCH] watchdog: armada_37xx_wdt: check the return value of devm_ioremap() in armada_37xx_wdt_probe() williamsukatube
2022-07-22  3:42 ` Guenter Roeck
2022-07-22  7:14 ` Marek Behún [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220722091431.1572e92c@dellmb \
    --to=kabel@kernel.org \
    --cc=hacashRobot@santino.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=williamsukatube@163.com \
    --cc=williamsukatube@gmail.com \
    --cc=wim@linux-watchdog.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.