net: phy: Fix crash when no phy is found
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
d95f27aaa8
commit
d9a08d8bc5
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue