Re: [PATCH v2 2/2] net: macb: add of_node_put to error paths

2017-11-08 Thread Nicolas Ferre
On 08/11/2017 at 09:56, Michael Grzeschik wrote:
> We add the call of_node_put(bp->phy_node) to all associated error
> paths for memory clean up.
> 
> Signed-off-by: Michael Grzeschik 
Acked-by: Nicolas Ferre 
> ---
> v2: removed extra of_node_put from macb_remove
> 
>  drivers/net/ethernet/cadence/macb_main.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ethernet/cadence/macb_main.c 
> b/drivers/net/ethernet/cadence/macb_main.c
> index b7846d6e9234e..0f24ca5a24b53 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -611,6 +611,7 @@ static int macb_mii_init(struct macb *bp)
>  err_out_unregister_bus:
>   mdiobus_unregister(bp->mii_bus);
>  err_out_free_mdiobus:
> + of_node_put(bp->phy_node);
>   if (np && of_phy_is_fixed_link(np))
>   of_phy_deregister_fixed_link(np);
>   mdiobus_free(bp->mii_bus);
> @@ -3554,6 +3555,7 @@ static int macb_probe(struct platform_device *pdev)
>  err_out_unregister_mdio:
>   phy_disconnect(dev->phydev);
>   mdiobus_unregister(bp->mii_bus);
> + of_node_put(bp->phy_node);
>   if (np && of_phy_is_fixed_link(np))
>   of_phy_deregister_fixed_link(np);
>   mdiobus_free(bp->mii_bus);
> 


-- 
Nicolas Ferre


[PATCH v2 2/2] net: macb: add of_node_put to error paths

2017-11-08 Thread Michael Grzeschik
We add the call of_node_put(bp->phy_node) to all associated error
paths for memory clean up.

Signed-off-by: Michael Grzeschik 
---
v2: removed extra of_node_put from macb_remove

 drivers/net/ethernet/cadence/macb_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/cadence/macb_main.c 
b/drivers/net/ethernet/cadence/macb_main.c
index b7846d6e9234e..0f24ca5a24b53 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -611,6 +611,7 @@ static int macb_mii_init(struct macb *bp)
 err_out_unregister_bus:
mdiobus_unregister(bp->mii_bus);
 err_out_free_mdiobus:
+   of_node_put(bp->phy_node);
if (np && of_phy_is_fixed_link(np))
of_phy_deregister_fixed_link(np);
mdiobus_free(bp->mii_bus);
@@ -3554,6 +3555,7 @@ static int macb_probe(struct platform_device *pdev)
 err_out_unregister_mdio:
phy_disconnect(dev->phydev);
mdiobus_unregister(bp->mii_bus);
+   of_node_put(bp->phy_node);
if (np && of_phy_is_fixed_link(np))
of_phy_deregister_fixed_link(np);
mdiobus_free(bp->mii_bus);
-- 
2.11.0