From: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
To: devicetree@vger.kernel.org, linux-media@vger.kernel.org
Cc: "Sakari Ailus" <sakari.ailus@linux.intel.com>,
"Kieran Bingham" <kieran.bingham@ideasonboard.com>,
linux-renesas-soc@vger.kernel.org,
"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Subject: [PATCH v2] device property: preserve usecount for node passed to of_fwnode_graph_get_port_parent()
Date: Tue, 22 Aug 2017 02:19:12 +0200 [thread overview]
Message-ID: <20170822001912.27638-1-niklas.soderlund+renesas@ragnatech.se> (raw)
Using CONFIG_OF_DYNAMIC=y uncovered an imbalance in the usecount of the
node being passed to of_fwnode_graph_get_port_parent(). Preserve the
usecount by using of_get_parent() instead of of_get_next_parent() which
don't decrement the usecount of the node passed to it.
Fixes: 3b27d00e7b6d7c88 ("device property: Move fwnode graph ops to firmware specific locations")
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
drivers/of/property.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/of/property.c b/drivers/of/property.c
index 067f9fab7b77c794..59afeea9888e3b3d 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -923,7 +923,7 @@ of_fwnode_graph_get_port_parent(struct fwnode_handle *fwnode)
struct device_node *np;
/* Get the parent of the port */
- np = of_get_next_parent(to_of_node(fwnode));
+ np = of_get_parent(to_of_node(fwnode));
if (!np)
return NULL;
--
2.14.0
next reply other threads:[~2017-08-22 0:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-22 0:19 Niklas Söderlund [this message]
2017-08-22 14:49 ` [PATCH v2] device property: preserve usecount for node passed to of_fwnode_graph_get_port_parent() Rob Herring
2017-08-22 14:58 ` Geert Uytterhoeven
2017-08-22 15:00 ` Niklas Söderlund
2017-08-22 19:42 ` Rob Herring
2017-08-27 22:40 ` Sakari Ailus
2017-10-03 13:40 ` Rob Herring
2017-10-04 12:30 ` Sakari Ailus
2017-10-04 12:48 ` Rob Herring
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=20170822001912.27638-1-niklas.soderlund+renesas@ragnatech.se \
--to=niklas.soderlund+renesas@ragnatech.se \
--cc=devicetree@vger.kernel.org \
--cc=kieran.bingham@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=sakari.ailus@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).