9
0
Fork 0

net: phy: Fix crash when no phy is found

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2014-01-17 15:01:49 +01:00
parent d95f27aaa8
commit d9a08d8bc5
1 changed files with 5 additions and 0 deletions

View File

@ -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)