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

Michal Simek michal.simek at xilinx.com
Thu Feb 11 19:02:27 CET 2021



On 2/10/21 10:41 PM, Michael Walle 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:
> 


Applied.
M


More information about the U-Boot mailing list