mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 06:49:29 -04:00
net: ethernet: adi: Fix return value check in adin1110_probe_netdevs()
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: bc93e19d08 ("net: ethernet: adi: Add ADIN1110 support")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20220922021023.811581-1-weiyongjun@huaweicloud.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
01bcfc1a16
commit
9f1e337851
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user