Clean up error path in connection where priv->rxbuffers and priv->tx_bd are
allocated.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
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;
}
}
err3:
mdio_unregister(priv->bus);
err2:
- free(priv->rxbuffers);
-err1:
free(priv->tx_bd);
+err1:
+ free(priv->rxbuffers);
return ret;
}