From: "Clément Léger" <clement.leger@bootlin.com>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
<linux-renesas-soc@vger.kernel.org>, <olteanv@gmail.com>,
<f.fainelli@gmail.com>, <davem@davemloft.net>
Subject: Re: [PATCH -next v2] net: pcs-rzn1-miic: fix return value check in miic_probe()
Date: Wed, 29 Jun 2022 11:15:30 +0200 [thread overview]
Message-ID: <20220629111530.3b74c014@fixe.home> (raw)
In-Reply-To: <20220628131259.3109124-1-yangyingliang@huawei.com>
Le Tue, 28 Jun 2022 21:12:59 +0800,
Yang Yingliang <yangyingliang@huawei.com> a écrit :
> On failure, devm_platform_ioremap_resource() returns a ERR_PTR() value
> and not NULL. Fix return value checking by using IS_ERR() and return
> PTR_ERR() as error value.
>
> Fixes: 7dc54d3b8d91 ("net: pcs: add Renesas MII converter driver")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
> v2:
> change commit message as Clément suggested.
> ---
> drivers/net/pcs/pcs-rzn1-miic.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/pcs/pcs-rzn1-miic.c b/drivers/net/pcs/pcs-rzn1-miic.c
> index 8f5e910f443d..d896961e48cc 100644
> --- a/drivers/net/pcs/pcs-rzn1-miic.c
> +++ b/drivers/net/pcs/pcs-rzn1-miic.c
> @@ -461,8 +461,8 @@ static int miic_probe(struct platform_device *pdev)
> spin_lock_init(&miic->lock);
> miic->dev = dev;
> miic->base = devm_platform_ioremap_resource(pdev, 0);
> - if (!miic->base)
> - return -EINVAL;
> + if (IS_ERR(miic->base))
> + return PTR_ERR(miic->base);
>
> ret = devm_pm_runtime_enable(dev);
> if (ret < 0)
LGTM, 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:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-28 13:12 [PATCH -next v2] net: pcs-rzn1-miic: fix return value check in miic_probe() Yang Yingliang
2022-06-29 9:15 ` 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=20220629111530.3b74c014@fixe.home \
--to=clement.leger@bootlin.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=yangyingliang@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox