提交 845a57b4 编写于 作者: M Måns Rullgård 提交者: Stefano Babic

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: NMans Rullgard <mans@mansr.com>
Reviewed-by: NEric Nelson <eric@nelint.com>
上级 843a3e58
......@@ -1109,6 +1109,7 @@ int fecmxc_initialize_multi(bd_t *bd, int dev_id, int phy_id, uint32_t addr)
#ifdef CONFIG_PHYLIB
phydev = phy_find_by_mask(bus, 1 << phy_id, PHY_INTERFACE_MODE_RGMII);
if (!phydev) {
mdio_unregister(bus);
free(bus);
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
free(phydev);
#endif
mdio_unregister(bus);
free(bus);
}
return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册