Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1560527 > unrolled thread

[PATCH] stmmac: add missing of_node_put

Started byJulia Lawall <Julia.Lawall@lip6.fr>
First post2017-01-17 12:50 +0100
Last post2017-01-17 20:20 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] stmmac: add missing of_node_put Julia Lawall <Julia.Lawall@lip6.fr> - 2017-01-17 12:50 +0100
    Re: [PATCH] stmmac: add missing of_node_put Alexandre Torgue <alexandre.torgue@st.com> - 2017-01-17 15:40 +0100
    Re: [PATCH] stmmac: add missing of_node_put David Miller <davem@davemloft.net> - 2017-01-17 20:20 +0100

#1560527 — [PATCH] stmmac: add missing of_node_put

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2017-01-17 12:50 +0100
Subject[PATCH] stmmac: add missing of_node_put
Message-ID<t0Ar0-6A1-13@gated-at.bofh.it>
The function stmmac_dt_phy provides several possibilities for initializing
plat->mdio_node, all of which have the effect of increasing the reference
count of the assigned value.  This field is not updated elsewhere, so the
value is live until the end of the lifetime of plat (devm_allocated), just
after the end of stmmac_remove_config_dt.  Thus, add an of_node_put on
plat->mdio_node in stmmac_remove_config_dt.  It is possible that the field
mdio_node is never initialized, but of_node_put is NULL-safe, so it is also
safe to call of_node_put in that case.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 4daa8a3..460f94f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -409,6 +409,7 @@ void stmmac_remove_config_dt(struct platform_device *pdev,
 	if (of_phy_is_fixed_link(np))
 		of_phy_deregister_fixed_link(np);
 	of_node_put(plat->phy_node);
+	of_node_put(plat->mdio_node);
 }
 #else
 struct plat_stmmacenet_data *

[toc] | [next] | [standalone]


#1560654

FromAlexandre Torgue <alexandre.torgue@st.com>
Date2017-01-17 15:40 +0100
Message-ID<t0D5w-8eI-27@gated-at.bofh.it>
In reply to#1560527
Hi

On 01/17/2017 12:23 PM, Julia Lawall wrote:
> The function stmmac_dt_phy provides several possibilities for initializing
> plat->mdio_node, all of which have the effect of increasing the reference
> count of the assigned value.  This field is not updated elsewhere, so the
> value is live until the end of the lifetime of plat (devm_allocated), just
> after the end of stmmac_remove_config_dt.  Thus, add an of_node_put on
> plat->mdio_node in stmmac_remove_config_dt.  It is possible that the field
> mdio_node is never initialized, but of_node_put is NULL-safe, so it is also
> safe to call of_node_put in that case.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> index 4daa8a3..460f94f 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -409,6 +409,7 @@ void stmmac_remove_config_dt(struct platform_device *pdev,
>  	if (of_phy_is_fixed_link(np))
>  		of_phy_deregister_fixed_link(np);
>  	of_node_put(plat->phy_node);
> +	of_node_put(plat->mdio_node);
>  }
>  #else
>  struct plat_stmmacenet_data *
>

Acked-by: Alexandre TORGUE <alexandre.torgue@st.com>

Thanks
Alex

[toc] | [prev] | [next] | [standalone]


#1560945

FromDavid Miller <davem@davemloft.net>
Date2017-01-17 20:20 +0100
Message-ID<t0Hsu-2y1-33@gated-at.bofh.it>
In reply to#1560527
From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Tue, 17 Jan 2017 12:23:21 +0100

> The function stmmac_dt_phy provides several possibilities for initializing
> plat->mdio_node, all of which have the effect of increasing the reference
> count of the assigned value.  This field is not updated elsewhere, so the
> value is live until the end of the lifetime of plat (devm_allocated), just
> after the end of stmmac_remove_config_dt.  Thus, add an of_node_put on
> plat->mdio_node in stmmac_remove_config_dt.  It is possible that the field
> mdio_node is never initialized, but of_node_put is NULL-safe, so it is also
> safe to call of_node_put in that case.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied, thanks Julia.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web