mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-18 06:58:54 +00:00
net: fec_mxc: unregister mdio bus on probe error
If fecmxc_initialize_multi() fails, it frees but does not unregister the mdio bus, causing subsequent uses of the "mii" command to crash. Fix this by adding mdio_unregister() calls where needed. Signed-off-by: Mans Rullgard <mans@mansr.com> Reviewed-by: Eric Nelson <eric@nelint.com>
This commit is contained in:
parent
843a3e5893
commit
845a57b4de
1 changed files with 2 additions and 0 deletions
|
@ -1109,6 +1109,7 @@ int fecmxc_initialize_multi(bd_t *bd, int dev_id, int phy_id, uint32_t addr)
|
||||||
#ifdef CONFIG_PHYLIB
|
#ifdef CONFIG_PHYLIB
|
||||||
phydev = phy_find_by_mask(bus, 1 << phy_id, PHY_INTERFACE_MODE_RGMII);
|
phydev = phy_find_by_mask(bus, 1 << phy_id, PHY_INTERFACE_MODE_RGMII);
|
||||||
if (!phydev) {
|
if (!phydev) {
|
||||||
|
mdio_unregister(bus);
|
||||||
free(bus);
|
free(bus);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
@ -1120,6 +1121,7 @@ int fecmxc_initialize_multi(bd_t *bd, int dev_id, int phy_id, uint32_t addr)
|
||||||
#ifdef CONFIG_PHYLIB
|
#ifdef CONFIG_PHYLIB
|
||||||
free(phydev);
|
free(phydev);
|
||||||
#endif
|
#endif
|
||||||
|
mdio_unregister(bus);
|
||||||
free(bus);
|
free(bus);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Add table
Reference in a new issue