lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1e07016b-6af7-366a-afa3-67868db64abd@microchip.com>
Date:   Mon, 6 Nov 2017 15:37:14 +0100
From:   Nicolas Ferre <nicolas.ferre@...rochip.com>
To:     Michael Grzeschik <m.grzeschik@...gutronix.de>
CC:     <netdev@...r.kernel.org>, <kernel@...gutronix.de>, <andrew@...n.ch>
Subject: Re: [PATCH 1/2] net: macb: add of_phy_deregister_fixed_link to error
 paths

On 06/11/2017 at 12:10, Michael Grzeschik wrote:
> We add the call of_phy_deregister_fixed_link to all associated
> error paths for memory clean up.
> 
> Signed-off-by: Michael Grzeschik <m.grzeschik@...gutronix.de>

Acked-by: Nicolas Ferre <nicolas.ferre@...rochip.com>

Thanks a lot for your quick answer!

Best regards,
  Nicolas

> ---
>  drivers/net/ethernet/cadence/macb_main.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 6df2cad61647a..2c2acd011329a 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -611,6 +611,8 @@ static int macb_mii_init(struct macb *bp)
>  err_out_unregister_bus:
>  	mdiobus_unregister(bp->mii_bus);
>  err_out_free_mdiobus:
> +	if ((np) && (of_phy_is_fixed_link(np)))
> +		of_phy_deregister_fixed_link(np);
>  	mdiobus_free(bp->mii_bus);
>  err_out:
>  	return err;
> @@ -3552,6 +3554,8 @@ static int macb_probe(struct platform_device *pdev)
>  err_out_unregister_mdio:
>  	phy_disconnect(dev->phydev);
>  	mdiobus_unregister(bp->mii_bus);
> +	if ((np) && (of_phy_is_fixed_link(np)))
> +		of_phy_deregister_fixed_link(np);
>  	mdiobus_free(bp->mii_bus);
>  
>  	/* Shutdown the PHY if there is a GPIO reset */
> @@ -3574,6 +3578,7 @@ static int macb_remove(struct platform_device *pdev)
>  {
>  	struct net_device *dev;
>  	struct macb *bp;
> +	struct device_node *np = pdev->dev.of_node;
>  
>  	dev = platform_get_drvdata(pdev);
>  
> @@ -3582,6 +3587,8 @@ static int macb_remove(struct platform_device *pdev)
>  		if (dev->phydev)
>  			phy_disconnect(dev->phydev);
>  		mdiobus_unregister(bp->mii_bus);
> +		if ((np) && (of_phy_is_fixed_link(np)))
> +			of_phy_deregister_fixed_link(np);
>  		dev->phydev = NULL;
>  		mdiobus_free(bp->mii_bus);
>  
> 


-- 
Nicolas Ferre

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ