Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: bc93e19d088b ("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>

authored by

Wei Yongjun and committed by
Jakub Kicinski
9f1e3378 01bcfc1a

+2 -2
+2 -2
drivers/net/ethernet/adi/adin1110.c
··· 1582 1582 netdev->features |= NETIF_F_NETNS_LOCAL; 1583 1583 1584 1584 port_priv->phydev = get_phy_device(priv->mii_bus, i + 1, false); 1585 - if (!port_priv->phydev) { 1585 + if (IS_ERR(port_priv->phydev)) { 1586 1586 netdev_err(netdev, "Could not find PHY with device address: %d.\n", i); 1587 - return -ENODEV; 1587 + return PTR_ERR(port_priv->phydev); 1588 1588 } 1589 1589 1590 1590 port_priv->phydev = phy_connect(netdev,