lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1500420997-12018-1-git-send-email-frowand.list@gmail.com>
Date:   Tue, 18 Jul 2017 16:36:37 -0700
From:   frowand.list@...il.com
To:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>
Cc:     linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: [PATCH] regulator: of: regulator_of_get_init_data() missing of_node_get()

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

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

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@...y.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@...y.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ