Skip to contentSkip to conversation

Staging: octeon: Add missing of_node_put after calling of_parse_phandle

PATCH Superseded Sandhya Bankar 2 participants 2 messages Sep 18, 2016 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: octeon: Add missing of_node_put after calling of_parse_phandle

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

---
 drivers/staging/octeon/ethernet-mdio.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/staging/octeon/ethernet-mdio.c +1 -0
index 1fde9c8..691e4a5 100644
@@ -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;
Signature · 1 line
1.7.1
#1 lore raw
Quoted 2 lines · Sandhya Bankar

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

Quoted 39 lines

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

---
 drivers/staging/octeon/ethernet-mdio.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/staging/octeon/ethernet-mdio.c +1 -1
index 1fde9c8..691e4a5 100644
@@ -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 [email protected]. To post to this group, send email to [email protected].
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.