From: "Clément Léger" <clement.leger@bootlin.com>
To: Peng Wu <wupeng58@huawei.com>
Cc: <andrew@lunn.ch>, <vivien.didelot@gmail.com>,
<f.fainelli@gmail.com>, <olteanv@gmail.com>,
<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>, <linux-renesas-soc@vger.kernel.org>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<liwei391@huawei.com>
Subject: Re: [PATCH] net: dsa: rzn1-a5psw: fix a NULL vs IS_ERR() check in a5psw_probe()
Date: Wed, 29 Jun 2022 11:27:20 +0200 [thread overview]
Message-ID: <20220629112720.648619a8@fixe.home> (raw)
In-Reply-To: <20220628130920.49493-1-wupeng58@huawei.com>
Le Tue, 28 Jun 2022 13:09:20 +0000,
Peng Wu <wupeng58@huawei.com> a écrit :
> The devm_platform_ioremap_resource() function never returns NULL.
> It returns error pointers.
>
> Signed-off-by: Peng Wu <wupeng58@huawei.com>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> ---
> drivers/net/dsa/rzn1_a5psw.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c
> index 3e910da98ae2..5b14e2ba9b79 100644
> --- a/drivers/net/dsa/rzn1_a5psw.c
> +++ b/drivers/net/dsa/rzn1_a5psw.c
> @@ -946,8 +946,8 @@ static int a5psw_probe(struct platform_device *pdev)
> mutex_init(&a5psw->lk_lock);
> spin_lock_init(&a5psw->reg_lock);
> a5psw->base = devm_platform_ioremap_resource(pdev, 0);
> - if (!a5psw->base)
> - return -EINVAL;
> + if (IS_ERR(a5psw->base))
> + return PTR_ERR(a5psw->base);
>
> ret = a5psw_pcs_get(a5psw);
> if (ret)
Thanks,
Reviewed-by: Clément Léger <clement.leger@bootlin.com>
--
Clément Léger,
Embedded Linux and Kernel engineer at Bootlin
https://bootlin.com
next prev parent reply other threads:[~2022-06-29 9:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-28 13:09 [PATCH] net: dsa: rzn1-a5psw: fix a NULL vs IS_ERR() check in a5psw_probe() Peng Wu
2022-06-29 9:27 ` Clément Léger [this message]
2022-06-30 4:10 ` patchwork-bot+netdevbpf
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=20220629112720.648619a8@fixe.home \
--to=clement.leger@bootlin.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=liwei391@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=vivien.didelot@gmail.com \
--cc=wupeng58@huawei.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 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.