All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sandhya Bankar <bankarsandhya512@gmail.com>
To: outreachy-kernel@googlegroups.com
Cc: gregkh@linuxfoundation.org
Subject: [PATCH] Staging: octeon: Add missing of_node_put after calling of_parse_phandle
Date: Sun, 18 Sep 2016 19:18:15 +0530	[thread overview]
Message-ID: <20160918134815.GA3515@sandhya> (raw)

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



             reply	other threads:[~2016-09-18 13:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-18 13:48 Sandhya Bankar [this message]
2016-09-18 15:31 ` [Outreachy kernel] [PATCH] Staging: octeon: Add missing of_node_put after calling of_parse_phandle Julia Lawall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160918134815.GA3515@sandhya \
    --to=bankarsandhya512@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=outreachy-kernel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.