net: gem: unregister mdio bus if probe fails

If probe fails, the mdio bus isn't unregistered. Fix it.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This commit is contained in:
Michael Walle 2021-02-10 22:41:57 +01:00 committed by Michal Simek
parent 98757d87ee
commit 038e02455b

View file

@ -711,10 +711,12 @@ static int zynq_gem_probe(struct udevice *dev)
ret = zynq_phy_init(dev);
if (ret)
goto err2;
goto err3;
return ret;
err3:
mdio_unregister(priv->bus);
err2:
free(priv->rxbuffers);
err1: