Skip to contentSkip to conversation

drivers: cpufreq: Add missing of_node_put() in qoriq-cpufreq.c

PATCH In review heliang 2 participants 2 messages Jun 15, 2022 CPU frequency scaling framework

lore
Share & tools
lore

heliang

author
#0 lore raw

PATCH 1/1 drivers: cpufreq: Add missing of_node_put() in qoriq-cpufreq.c

In qoriq_cpufreq_probe(), of_find_matching_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore.

---
 drivers/cpufreq/qoriq-cpufreq.c | 1 +
 1 file changed, 1 insertion(+)
drivers/cpufreq/qoriq-cpufreq.c +1 -0
index 6b6b20da2bcf..573b417e1483 100644
@@ -275,6 +275,7 @@ static int qoriq_cpufreq_probe(struct platform_device *pdev)
 
 	np = of_find_matching_node(NULL, qoriq_cpufreq_blacklist);
 	if (np) {
+		of_node_put(np);
 		dev_info(&pdev->dev, "Disabling due to erratum A-008083");
 		return -ENODEV;
 	}
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 14 lines · heliang

In qoriq_cpufreq_probe(), of_find_matching_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore.

---
 drivers/cpufreq/qoriq-cpufreq.c | 1 +
 1 file changed, 1 insertion(+)
drivers/cpufreq/qoriq-cpufreq.c +0 -0
index 6b6b20da2bcf..573b417e1483 100644

drivers/cpufreq/qoriq-cpufreq.c static int qoriq_cpufreq_probe(struct platform_device *pdev) · line 281

Quoted 7 lines
drivers/cpufreq/qoriq-cpufreq.c +1 -0
@@ -275,6 +275,7 @@ static int qoriq_cpufreq_probe(struct platform_device *pdev)
 
 	np = of_find_matching_node(NULL, qoriq_cpufreq_blacklist);
 	if (np) {
+		of_node_put(np);
 		dev_info(&pdev->dev, "Disabling due to erratum A-008083");
 		return -ENODEV;
 	}

Applied with fixes tag. Thanks.

Signature · 1 line
viresh