mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-25 16:41:34 +00:00
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: Marek Behun <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
This commit is contained in:
parent
2d7a0f4399
commit
cf2cf8510a
1 changed files with 4 additions and 0 deletions
|
@ -1562,6 +1562,10 @@ static int mvneta_start(struct udevice *dev)
|
|||
|
||||
phydev = phy_connect(pp->bus, pp->phyaddr, dev,
|
||||
pp->phy_interface);
|
||||
if (!phydev) {
|
||||
printf("phy_connect failed\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
pp->phydev = phydev;
|
||||
phy_config(phydev);
|
||||
|
|
Loading…
Add table
Reference in a new issue