* [PATCH] Staging: octeon: Add missing of_node_put after calling of_parse_phandle
@ 2016-09-18 13:48 Sandhya Bankar
2016-09-18 15:31 ` [Outreachy kernel] " Julia Lawall
0 siblings, 1 reply; 2+ messages in thread
From: Sandhya Bankar @ 2016-09-18 13:48 UTC (permalink / raw)
To: outreachy-kernel; +Cc: gregkh
of_node_put needs to be called when the device node which is got
from of_parse_phandle has finished using.
This patch is found by below coccinelle script:
@@
expression e,e1,e2;
@@
*e = of_parse_phandle(...)
... when != of_node_put(e)
when != true e == NULL
when != e2 = e
e = e1
Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
---
drivers/staging/octeon/ethernet-mdio.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/staging/octeon/ethernet-mdio.c b/drivers/staging/octeon/ethernet-mdio.c
index 1fde9c8..691e4a5 100644
--- a/drivers/staging/octeon/ethernet-mdio.c
+++ b/drivers/staging/octeon/ethernet-mdio.c
@@ -168,6 +168,7 @@ int cvm_oct_phy_setup_device(struct net_device *dev)
phydev = of_phy_connect(dev, phy_node, cvm_oct_adjust_link, 0,
PHY_INTERFACE_MODE_GMII);
+ of_node_put(phy_node);
if (!phydev)
return -ENODEV;
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [Outreachy kernel] [PATCH] Staging: octeon: Add missing of_node_put after calling of_parse_phandle
2016-09-18 13:48 [PATCH] Staging: octeon: Add missing of_node_put after calling of_parse_phandle Sandhya Bankar
@ 2016-09-18 15:31 ` Julia Lawall
0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2016-09-18 15:31 UTC (permalink / raw)
To: Sandhya Bankar; +Cc: outreachy-kernel, gregkh
On Sun, 18 Sep 2016, Sandhya Bankar wrote:
> of_node_put needs to be called when the device node which is got
> from of_parse_phandle has finished using.
has finished using -> is no longer used
julia
>
> This patch is found by below coccinelle script:
>
> @@
> expression e,e1,e2;
> @@
> *e = of_parse_phandle(...)
> ... when != of_node_put(e)
> when != true e == NULL
> when != e2 = e
> e = e1
>
> Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
> ---
> drivers/staging/octeon/ethernet-mdio.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/staging/octeon/ethernet-mdio.c b/drivers/staging/octeon/ethernet-mdio.c
> index 1fde9c8..691e4a5 100644
> --- a/drivers/staging/octeon/ethernet-mdio.c
> +++ b/drivers/staging/octeon/ethernet-mdio.c
> @@ -168,6 +168,7 @@ int cvm_oct_phy_setup_device(struct net_device *dev)
>
> phydev = of_phy_connect(dev, phy_node, cvm_oct_adjust_link, 0,
> PHY_INTERFACE_MODE_GMII);
> + of_node_put(phy_node);
>
> if (!phydev)
> return -ENODEV;
> --
> 1.7.1
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160918134815.GA3515%40sandhya.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-18 15:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-18 13:48 [PATCH] Staging: octeon: Add missing of_node_put after calling of_parse_phandle Sandhya Bankar
2016-09-18 15:31 ` [Outreachy kernel] " Julia Lawall
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.