* [PATCH v2] Staging: octeon: Add missing of_node_put after calling of_parse_phandle.
@ 2016-09-18 17:32 Sandhya Bankar
0 siblings, 0 replies; only message in thread
From: Sandhya Bankar @ 2016-09-18 17:32 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 is no longer used.
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>
---
Changes in v2:
* Correcting the commit message.
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] only message in thread
only message in thread, other threads:[~2016-09-18 17:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-18 17:32 [PATCH v2] Staging: octeon: Add missing of_node_put after calling of_parse_phandle Sandhya Bankar
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.