Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Claudiu Beznea <claudiu.beznea@microchip.com>
Cc: alexandre.belloni@bootlin.com, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, ludovic.desroches@microchip.com,
	Cristian Birsan <cristian.birsan@microchip.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] power: reset: at91-reset: check properly the return value of devm_of_iomap
Date: Sat, 2 Oct 2021 17:44:23 +0200	[thread overview]
Message-ID: <20211002154423.7nqf4cjdhwt3o7yr@earth.universe> (raw)
In-Reply-To: <20210930100928.2211599-1-claudiu.beznea@microchip.com>


[-- Attachment #1.1: Type: text/plain, Size: 1587 bytes --]

Hi,

On Thu, Sep 30, 2021 at 01:09:28PM +0300, Claudiu Beznea wrote:
> devm_of_iomap() returns error code or valid pointer. Check its return
> value with IS_ERR().
> 
> Fixes: bd3127733f2c ("power: reset: at91-reset: use devm_of_iomap")
> Reported-by: Cristian Birsan <cristian.birsan@microchip.com>
> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/reset/at91-reset.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/power/reset/at91-reset.c b/drivers/power/reset/at91-reset.c
> index 026649409135..64def79d557a 100644
> --- a/drivers/power/reset/at91-reset.c
> +++ b/drivers/power/reset/at91-reset.c
> @@ -193,7 +193,7 @@ static int __init at91_reset_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  
>  	reset->rstc_base = devm_of_iomap(&pdev->dev, pdev->dev.of_node, 0, NULL);
> -	if (!reset->rstc_base) {
> +	if (IS_ERR(reset->rstc_base)) {
>  		dev_err(&pdev->dev, "Could not map reset controller address\n");
>  		return -ENODEV;
>  	}
> @@ -203,7 +203,7 @@ static int __init at91_reset_probe(struct platform_device *pdev)
>  		for_each_matching_node_and_match(np, at91_ramc_of_match, &match) {
>  			reset->ramc_lpr = (u32)match->data;
>  			reset->ramc_base[idx] = devm_of_iomap(&pdev->dev, np, 0, NULL);
> -			if (!reset->ramc_base[idx]) {
> +			if (IS_ERR(reset->ramc_base[idx])) {
>  				dev_err(&pdev->dev, "Could not map ram controller address\n");
>  				of_node_put(np);
>  				return -ENODEV;
> -- 
> 2.25.1
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2021-10-02 15:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-30 10:09 [PATCH] power: reset: at91-reset: check properly the return value of devm_of_iomap Claudiu Beznea
2021-10-02 15:44 ` Sebastian Reichel [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=20211002154423.7nqf4cjdhwt3o7yr@earth.universe \
    --to=sebastian.reichel@collabora.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=claudiu.beznea@microchip.com \
    --cc=cristian.birsan@microchip.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=ludovic.desroches@microchip.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox