Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752197AbdGRXhB (ORCPT ); Tue, 18 Jul 2017 19:37:01 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34426 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751794AbdGRXg7 (ORCPT ); Tue, 18 Jul 2017 19:36:59 -0400 From: frowand.list@gmail.com To: Liam Girdwood , Mark Brown 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 Message-Id: <1500420997-12018-1-git-send-email-frowand.list@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1183 Lines: 34 From: Frank Rowand 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 --- 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