* [PATCH net-next] net: ethernet: adi: Fix return value check in adin1110_probe_netdevs()
@ 2022-09-22 2:10 Wei Yongjun
2022-09-26 19:50 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2022-09-22 2:10 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Lennart Franzen, Alexandru Tachici
Cc: Wei Yongjun, netdev, kernel-janitors
From: Wei Yongjun <weiyongjun1@huawei.com>
In case of error, the function get_phy_device() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().
Fixes: bc93e19d088b ("net: ethernet: adi: Add ADIN1110 support")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/net/ethernet/adi/adin1110.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/adi/adin1110.c b/drivers/net/ethernet/adi/adin1110.c
index 4dacb98e7e0a..eac4e27719ab 100644
--- a/drivers/net/ethernet/adi/adin1110.c
+++ b/drivers/net/ethernet/adi/adin1110.c
@@ -1582,9 +1582,9 @@ static int adin1110_probe_netdevs(struct adin1110_priv *priv)
netdev->features |= NETIF_F_NETNS_LOCAL;
port_priv->phydev = get_phy_device(priv->mii_bus, i + 1, false);
- if (!port_priv->phydev) {
+ if (IS_ERR(port_priv->phydev)) {
netdev_err(netdev, "Could not find PHY with device address: %d.\n", i);
- return -ENODEV;
+ return PTR_ERR(port_priv->phydev);
}
port_priv->phydev = phy_connect(netdev,
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: ethernet: adi: Fix return value check in adin1110_probe_netdevs()
2022-09-22 2:10 [PATCH net-next] net: ethernet: adi: Fix return value check in adin1110_probe_netdevs() Wei Yongjun
@ 2022-09-26 19:50 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-09-26 19:50 UTC (permalink / raw)
To: Wei Yongjun
Cc: davem, edumazet, kuba, pabeni, lennart, alexandru.tachici,
weiyongjun1, netdev, kernel-janitors
Hello:
This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 22 Sep 2022 02:10:23 +0000 you wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> In case of error, the function get_phy_device() returns ERR_PTR()
> and never returns NULL. The NULL test in the return value check
> should be replaced with IS_ERR().
>
> Fixes: bc93e19d088b ("net: ethernet: adi: Add ADIN1110 support")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
>
> [...]
Here is the summary with links:
- [net-next] net: ethernet: adi: Fix return value check in adin1110_probe_netdevs()
https://git.kernel.org/netdev/net-next/c/9f1e337851be
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-26 19:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-22 2:10 [PATCH net-next] net: ethernet: adi: Fix return value check in adin1110_probe_netdevs() Wei Yongjun
2022-09-26 19:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).