summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/phy/phy.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 6ca1bb2573..faa5c26c22 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -290,6 +290,11 @@ int phy_device_connect(struct eth_device *edev, struct mii_bus *bus, int addr,
if (!IS_ERR(dev) && !dev->attached_dev)
break;
}
+
+ if (IS_ERR(dev)) {
+ ret = PTR_ERR(dev);
+ goto fail;
+ }
}
if (dev->attached_dev)