]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: gem: unregister mdio bus if probe fails
authorMichael Walle <michael@walle.cc>
Wed, 10 Feb 2021 21:41:57 +0000 (22:41 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 11 Feb 2021 18:06:44 +0000 (19:06 +0100)
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>
drivers/net/zynq_gem.c

index 5cb02bb3a7d25160c7ba9b5edc8e760df32f2691..585c06d6bd87f11cf28d5572b2676a05a763eda3 100644 (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: