All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Cercueil <paul@crapouillou.net>
To: 'Wei Yongjun <weiyongjun1@huawei.com>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
	Guenter Roeck <linux@roeck-us.net>,
	linux-mips@vger.kernel.org, linux-watchdog@vger.kernel.org,
	kernel-janitors@vger.kernel.org, Hulk Robot <hulkci@huawei.com>
Subject: Re: [PATCH -next] watchdog: jz4740: Fix return value check in jz4740_wdt_probe()
Date: Sun, 07 Mar 2021 15:55:36 +0000	[thread overview]
Message-ID: <O8WLPQ.PW3WC815EH61@crapouillou.net> (raw)
In-Reply-To: <20210304045909.945799-1-weiyongjun1@huawei.com>



Le jeu. 4 mars 2021 à 4:59, 'Wei Yongjun <weiyongjun1@huawei.com> a 
écrit :
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> In case of error, the function device_node_to_regmap() returns
> ERR_PTR() and never returns NULL. The NULL test in the return
> value check should be replaced with IS_ERR().
> 
> Fixes: 6d532143c915 ("watchdog: jz4740: Use regmap provided by TCU 
> driver")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Acked-by: Paul Cercueil <paul@crapouillou.net>

Cheers,
-Paul

> ---
>  drivers/watchdog/jz4740_wdt.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/watchdog/jz4740_wdt.c 
> b/drivers/watchdog/jz4740_wdt.c
> index bdf9564efa29..395bde79e292 100644
> --- a/drivers/watchdog/jz4740_wdt.c
> +++ b/drivers/watchdog/jz4740_wdt.c
> @@ -176,9 +176,9 @@ static int jz4740_wdt_probe(struct 
> platform_device *pdev)
>  	watchdog_set_drvdata(jz4740_wdt, drvdata);
> 
>  	drvdata->map = device_node_to_regmap(dev->parent->of_node);
> -	if (!drvdata->map) {
> +	if (IS_ERR(drvdata->map)) {
>  		dev_err(dev, "regmap not found\n");
> -		return -EINVAL;
> +		return PTR_ERR(drvdata->map);
>  	}
> 
>  	return devm_watchdog_register_device(dev, &drvdata->wdt);
> 



  reply	other threads:[~2021-03-07 15:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-04  4:59 [PATCH -next] watchdog: jz4740: Fix return value check in jz4740_wdt_probe() 'Wei Yongjun
2021-03-07 15:55 ` Paul Cercueil [this message]
2021-05-17 22:36 ` Guenter Roeck

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=O8WLPQ.PW3WC815EH61@crapouillou.net \
    --to=paul@crapouillou.net \
    --cc=hulkci@huawei.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=weiyongjun1@huawei.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.