Skip to contentSkip to conversation

cpufreq: pmac64: add of_node_put()

PATCH In review Yangtao Li 3 participants 3 messages Nov 23, 2018 – Dec 11, 2018

Subsystems (2)
lore
Share & tools
lore

Yangtao Li

author
#0 lore raw

PATCH v2 1/1 cpufreq: pmac64: add of_node_put()

of_find_node_by_path() acquires a reference to the node returned by it and that reference needs to be dropped by its caller. g5_neo2_cpufreq_init() doesn't do that, so fix it.

---
Changes in v2:
-update changelog

---
 drivers/cpufreq/pmac64-cpufreq.c | 1 +
 1 file changed, 1 insertion(+)
drivers/cpufreq/pmac64-cpufreq.c +1 -0
index be623dd7b9f2..1d32a863332d 100644
@@ -411,6 +411,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpunode)
 		pfunc_set_vdnap0 = pmf_find_function(root, "set-vdnap0");
 		pfunc_vdnap0_complete =
 			pmf_find_function(root, "slewing-done");
+		of_node_put(root);
 		if (pfunc_set_vdnap0 == NULL ||
 		    pfunc_vdnap0_complete == NULL) {
 			pr_err("Can't find required platform function\n");
Signature · 1 line
2.17.0
maintainer Acked-by on v2 1/1
#1 lore raw
Quoted 18 lines · Yangtao Li

of_find_node_by_path() acquires a reference to the node returned by it and that reference needs to be dropped by its caller. g5_neo2_cpufreq_init() doesn't do that, so fix it.

---
Changes in v2:

(quoted diff) +0 -2
-update changelog
---
 drivers/cpufreq/pmac64-cpufreq.c | 1 +
 1 file changed, 1 insertion(+)
drivers/cpufreq/pmac64-cpufreq.c +0 -0
index be623dd7b9f2..1d32a863332d 100644

drivers/cpufreq/pmac64-cpufreq.c static int __init g5_neo2_cpufreq_init(struct device_node *cpunode) · line 417

Quoted 7 lines
drivers/cpufreq/pmac64-cpufreq.c +1 -0
@@ -411,6 +411,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpunode)
 		pfunc_set_vdnap0 = pmf_find_function(root, "set-vdnap0");
 		pfunc_vdnap0_complete =
 			pmf_find_function(root, "slewing-done");
+		of_node_put(root);
 		if (pfunc_set_vdnap0 == NULL ||
 		    pfunc_vdnap0_complete == NULL) {
 			pr_err("Can't find required platform function\n");
Signature · 1 line
viresh
#2 lore raw
Quoted 14 lines · CET Viresh Kumar
Quoted 13 lines · Yangtao Li

of_find_node_by_path() acquires a reference to the node returned by it and that reference needs to be dropped by its caller. g5_neo2_cpufreq_init() doesn't do that, so fix it.

---
Changes in v2:
-update changelog

---
 drivers/cpufreq/pmac64-cpufreq.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 14 lines

drivers/cpufreq/pmac64-cpufreq.c static int __init g5_neo2_cpufreq_init(struct device_node *cpunode) · line 417

Quoted 12 lines
drivers/cpufreq/pmac64-cpufreq.c +1 -0
index be623dd7b9f2..1d32a863332d 100644
@@ -411,6 +411,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpunode)
 		pfunc_set_vdnap0 = pmf_find_function(root, "set-vdnap0");
 		pfunc_vdnap0_complete =
 			pmf_find_function(root, "slewing-done");
+		of_node_put(root);
 		if (pfunc_set_vdnap0 == NULL ||
 		    pfunc_vdnap0_complete == NULL) {
 			pr_err("Can't find required platform function\n");

Patch applied, thanks!