* [PATCH net-next] net: ethernet: ixp4xx: Fix return value check in ixp4xx_eth_probe()
@ 2021-05-19 14:16 Wei Yongjun
2021-05-19 20:20 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2021-05-19 14:16 UTC (permalink / raw)
To: weiyongjun1, Krzysztof Halasa, David S. Miller, Jakub Kicinski
Cc: netdev, kernel-janitors, Hulk Robot
In case of error, the function mdiobus_get_phy() returns NULL
pointer not ERR_PTR(). The IS_ERR() test in the return value
check should be replaced with NULL test.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/net/ethernet/xscale/ixp4xx_eth.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c
index cb89323855d8..1ecceeb9700d 100644
--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c
+++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c
@@ -1531,8 +1531,8 @@ static int ixp4xx_eth_probe(struct platform_device *pdev)
phydev = of_phy_get_and_connect(ndev, np, ixp4xx_adjust_link);
} else {
phydev = mdiobus_get_phy(mdio_bus, plat->phy);
- if (IS_ERR(phydev)) {
- err = PTR_ERR(phydev);
+ if (!phydev) {
+ err = -ENODEV;
dev_err(dev, "could not connect phydev (%d)\n", err);
goto err_free_mem;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: ethernet: ixp4xx: Fix return value check in ixp4xx_eth_probe()
2021-05-19 14:16 [PATCH net-next] net: ethernet: ixp4xx: Fix return value check in ixp4xx_eth_probe() Wei Yongjun
@ 2021-05-19 20:20 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-05-19 20:20 UTC (permalink / raw)
To: Wei Yongjun; +Cc: khalasa, davem, kuba, netdev, kernel-janitors, hulkci
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
On Wed, 19 May 2021 14:16:27 +0000 you wrote:
> In case of error, the function mdiobus_get_phy() returns NULL
> pointer not ERR_PTR(). The IS_ERR() test in the return value
> check should be replaced with NULL test.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
>
> [...]
Here is the summary with links:
- [net-next] net: ethernet: ixp4xx: Fix return value check in ixp4xx_eth_probe()
https://git.kernel.org/netdev/net-next/c/20e76d3d044d
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:[~2021-05-19 20:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19 14:16 [PATCH net-next] net: ethernet: ixp4xx: Fix return value check in ixp4xx_eth_probe() Wei Yongjun
2021-05-19 20:20 ` patchwork-bot+netdevbpf
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.