devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Sudeep Holla <sudeep.holla@arm.com>,
	Loys Ollivier <lollivier@baylibre.com>,
	Andy Gross <andy.gross@linaro.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>
Subject: [PATCH -next] of: platform: fix OF node refcount leak
Date: Thu, 18 Jan 2018 10:43:39 +0000	[thread overview]
Message-ID: <1516272219-25359-1-git-send-email-sudeep.holla@arm.com> (raw)

We need to call of_node_put() for device nodes obtained with
of_find_node_by_path().

Fixes: 3aa0582fdb82 ("of: platform: populate /firmware/ node from of_platform_default_populate_init()")
Reported-by: Loys Ollivier <lollivier@baylibre.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/of/platform.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Hi Rob,

You had Acked the original patch and it's queued via ARM SoC. So can you
please provide ack on this if you are OK with the change.

Regards,
Sudeep

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 6a01dab597c7..c00d81dfac0b 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -514,8 +514,10 @@ static int __init of_platform_default_populate_init(void)
 		of_platform_device_create(node, NULL, NULL);

 	node = of_find_node_by_path("/firmware");
-	if (node)
+	if (node) {
 		of_platform_populate(node, NULL, NULL, NULL);
+		of_node_put(node);
+	}

 	/* Populate everything else. */
 	of_platform_default_populate(NULL, NULL, NULL);
--
2.7.4

             reply	other threads:[~2018-01-18 10:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-18 10:43 Sudeep Holla [this message]
2018-01-18 14:57 ` [PATCH -next] of: platform: fix OF node refcount leak Rob Herring
     [not found] ` <1516272219-25359-1-git-send-email-sudeep.holla-5wv7dgnIgG8@public.gmane.org>
2018-01-19 15:37   ` Sudeep Holla
     [not found]     ` <fd9de06f-df7e-4114-8dda-0483c338b394-5wv7dgnIgG8@public.gmane.org>
2018-01-19 23:34       ` Andy Gross
     [not found]         ` <CAPBZ5QfuExQtM91wPCooiCoztoyt8ihXXWPccGi=_zca+eO5JA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-22 11:13           ` Sudeep Holla

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=1516272219-25359-1-git-send-email-sudeep.holla@arm.com \
    --to=sudeep.holla@arm.com \
    --cc=andy.gross@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lollivier@baylibre.com \
    --cc=robh+dt@kernel.org \
    /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).