Skip to content
Snippets Groups Projects
Commit cf2cf851 authored by Marek Behún's avatar Marek Behún Committed by Stefan Roese
Browse files

net: mvneta: Fix fault when wrong device tree


The driver does not check id phy_connect failed (for example on wrong
property name in device tree). In such a case a fault occurs and the
CPU is restarted.

Signed-off-by: default avatarMarek Behun <marek.behun@nic.cz>
Reviewed-by: default avatarStefan Roese <sr@denx.de>
Signed-off-by: default avatarStefan Roese <sr@denx.de>
parent 2d7a0f43
No related branches found
No related tags found
No related merge requests found
...@@ -1562,6 +1562,10 @@ static int mvneta_start(struct udevice *dev) ...@@ -1562,6 +1562,10 @@ static int mvneta_start(struct udevice *dev)
phydev = phy_connect(pp->bus, pp->phyaddr, dev, phydev = phy_connect(pp->bus, pp->phyaddr, dev,
pp->phy_interface); pp->phy_interface);
if (!phydev) {
printf("phy_connect failed\n");
return -ENODEV;
}
pp->phydev = phydev; pp->phydev = phydev;
phy_config(phydev); phy_config(phydev);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment