mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -next] ASoC: tegra: Add missing of_node_put() in tegra_machine_parse_phandle()
@ 2021-06-17 11:30 Zou Wei
  2021-06-17 12:36 ` Dmitry Osipenko
  0 siblings, 1 reply; 2+ messages in thread
From: Zou Wei @ 2021-06-17 11:30 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, thierry.reding, jonathanh
  Cc: alsa-devel, linux-tegra, linux-kernel, Zou Wei

The function is missing a of_node_put on node, fix this by adding the call
before returning.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
---
 sound/soc/tegra/tegra_asoc_machine.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/tegra/tegra_asoc_machine.c b/sound/soc/tegra/tegra_asoc_machine.c
index 397f326..cba55ca 100644
--- a/sound/soc/tegra/tegra_asoc_machine.c
+++ b/sound/soc/tegra/tegra_asoc_machine.c
@@ -336,9 +336,12 @@ tegra_machine_parse_phandle(struct device *dev, const char *name)
 	}
 
 	err = devm_add_action_or_reset(dev, tegra_machine_node_release, np);
-	if (err)
+	if (err) {
+		of_node_put(np);
 		return ERR_PTR(err);
+	}
 
+	of_node_put(np);
 	return np;
 }
 
-- 
2.6.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-17 12:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17 11:30 [PATCH -next] ASoC: tegra: Add missing of_node_put() in tegra_machine_parse_phandle() Zou Wei
2021-06-17 12:36 ` Dmitry Osipenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®