From 038e02455bbc18d34946fdfe77faf2062adc3e2a Mon Sep 17 00:00:00 2001 From: Michael Walle Date: Wed, 10 Feb 2021 22:41:57 +0100 Subject: [PATCH] net: gem: unregister mdio bus if probe fails If probe fails, the mdio bus isn't unregistered. Fix it. Signed-off-by: Michael Walle Reviewed-by: Ramon Fried Signed-off-by: Michal Simek --- drivers/net/zynq_gem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c index 5cb02bb3a7..585c06d6bd 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: -- 2.39.5