Skip to contentSkip to conversation

ASoC: tegra: Add missing of_node_put() in tegra_machine_parse_phandle()

PATCH In review Zou Wei 2 participants 2 messages Jun 17, 2021

Subsystems (3)
lore
Share & tools
lore

Zou Wei

author
#0 lore raw

PATCH 1/1 ASoC: tegra: Add missing of_node_put() in tegra_machine_parse_phandle()

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

---
 sound/soc/tegra/tegra_asoc_machine.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
sound/soc/tegra/tegra_asoc_machine.c +4 -1
index 397f326..cba55ca 100644
@@ -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;
 }
 
Signature · 1 line
2.6.2
#1 lore raw

17.06.2021 14:30, Zou Wei пишет:

Quoted 18 lines

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

---
 sound/soc/tegra/tegra_asoc_machine.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
sound/soc/tegra/tegra_asoc_machine.c +0 -0
index 397f326..cba55ca 100644
@@ -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);

sound/soc/tegra/tegra_asoc_machine.c tegra_machine_parse_phandle(struct device *dev, const char *name) · line 347

Quoted 10 lines
sound/soc/tegra/tegra_asoc_machine.c +4 -1
-	if (err)
+	if (err) {
+		of_node_put(np);
 		return ERR_PTR(err);
+	}
 
+	of_node_put(np);
 	return np;
 }
 

You haven't tried to check what this auto-generated patch does, haven't you? I assume it's auto-generated because it's a nonsense.