[PATCH] net: gem: unregister mdio bus if probe fails

Ramon Fried rfried.dev at gmail.com
Thu Feb 11 16:44:09 CET 2021


On Wed, Feb 10, 2021 at 11:42 PM Michael Walle <michael at walle.cc> wrote:
>
> If probe fails, the mdio bus isn't unregistered. Fix it.
>
> Signed-off-by: Michael Walle <michael at walle.cc>
> ---
>  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.20.1
>
Reviewed-by: Ramon Fried <rfried.dev at gmail.com>


More information about the U-Boot mailing list