All of lore.kernel.org
 help / color / mirror / Atom feed
* [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

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.