aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Walle2021-02-10 22:41:57 +0100
committerMichal Simek2021-02-11 19:06:44 +0100
commit038e02455bbc18d34946fdfe77faf2062adc3e2a (patch)
tree173b486c0aa73158270639aa4e3c4fef1836cbde
parent98757d87ee04cd8f57e9f2d6a8017a1d1a4ea646 (diff)
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>
-rw-r--r--drivers/net/zynq_gem.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c
index 5cb02bb3a7d..585c06d6bd8 100644
--- a/drivers/net/zynq_gem.c
+++ b/drivers/net/zynq_gem.c
@@ -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: