]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: gem: Fix error path in zynq_gem_probe
authorMichal Simek <michal.simek@xilinx.com>
Thu, 11 Feb 2021 18:03:30 +0000 (19:03 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 23 Feb 2021 13:56:59 +0000 (14:56 +0100)
Clean up error path in connection where priv->rxbuffers and priv->tx_bd are
allocated.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/net/zynq_gem.c

index 9ed013ee51247242937c36f5c320d06d914afc06..baf06a2ad8970fc71935dff2712548b8e46bfe14 100644 (file)
@@ -708,14 +708,14 @@ static int zynq_gem_probe(struct udevice *dev)
        ret = clk_get_by_name(dev, "tx_clk", &priv->tx_clk);
        if (ret < 0) {
                dev_err(dev, "failed to get tx_clock\n");
-               goto err1;
+               goto err2;
        }
 
        if (priv->clk_en_info & RXCLK_EN) {
                ret = clk_get_by_name(dev, "rx_clk", &priv->rx_clk);
                if (ret < 0) {
                        dev_err(dev, "failed to get rx_clock\n");
-                       goto err1;
+                       goto err2;
                }
        }
 
@@ -737,9 +737,9 @@ static int zynq_gem_probe(struct udevice *dev)
 err3:
        mdio_unregister(priv->bus);
 err2:
-       free(priv->rxbuffers);
-err1:
        free(priv->tx_bd);
+err1:
+       free(priv->rxbuffers);
        return ret;
 }