public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: frowand.list@gmail.com
To: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH] regulator: of: regulator_of_get_init_data() missing of_node_get()
Date: Tue, 18 Jul 2017 16:36:37 -0700	[thread overview]
Message-ID: <1500420997-12018-1-git-send-email-frowand.list@gmail.com> (raw)

From: Frank Rowand <frank.rowand@sony.com>

Boot fails for qcom-apq8074-dragonboard on 4.13-rc1 with error:
OF: ERROR: Bad of_node_put() on /soc/spmi@fc4cf000/pm8941@1/regulators

The error will occur if the configuration is set to:
   CONFIG_OF_OVERLAY y
   CONFIG_OF_UNITTEST y
   CONFIG_OF_DYNAMIC y
   CONFIG_OF_RESOLVE y

If CONFIG_OF_DYNAMIC is enabled then of_node_release() detects an
attempt to release a node that is still attached to the device tree.

Signed-off-by: Frank Rowand <frank.rowand@sony.com>
---
 drivers/regulator/of_regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index 96bf75458da5..9dd44dd4cdf6 100644
--- a/drivers/regulator/of_regulator.c
+++ b/drivers/regulator/of_regulator.c
@@ -333,7 +333,7 @@ struct regulator_init_data *regulator_of_get_init_data(struct device *dev,
 		search = of_get_child_by_name(dev->of_node,
 					      desc->regulators_node);
 	else
-		search = dev->of_node;
+		search = of_node_get(dev->of_node);
 
 	if (!search) {
 		dev_dbg(dev, "Failed to find regulator container node '%s'\n",
-- 
Frank Rowand <frank.rowand@sony.com>

             reply	other threads:[~2017-07-18 23:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-18 23:36 frowand.list [this message]
2017-07-19 11:27 ` Applied "regulator: of: regulator_of_get_init_data() missing of_node_get()" to the regulator tree Mark Brown

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=1500420997-12018-1-git-send-email-frowand.list@gmail.com \
    --to=frowand.list@gmail.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.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