Skip to contentSkip to conversation

arch_topology: Fix putting invalid cpu clk

PATCH Superseded Jeffy Chen 3 participants 4 messages Mar 17, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jeffy Chen

author
#0 lore raw

PATCH 1/1 arch_topology: Fix putting invalid cpu clk

Add a sanity check before putting the cpu clk.

Fixes 2a6d1c6bcd1f (“arch_topology: Adjust initial CPU capacities with current freq")

---

 drivers/base/arch_topology.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/base/arch_topology.c +3 -3
index 8a9fe2bc8635..4d0a0038b476 100644
@@ -176,11 +176,11 @@ bool __init topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu)
 		 * frequency (by keeping the initial freq_factor value).
 		 */
 		cpu_clk = of_clk_get(cpu_node, 0);
-		if (!PTR_ERR_OR_ZERO(cpu_clk))
+		if (!PTR_ERR_OR_ZERO(cpu_clk)) {
 			per_cpu(freq_factor, cpu) =
 				clk_get_rate(cpu_clk) / 1000;
-
-		clk_put(cpu_clk);
+			clk_put(cpu_clk);
+		}
 	} else {
 		if (raw_capacity) {
 			pr_err("cpu_capacity: missing %pOF raw capacity\n",
Signature · 1 line
2.11.0
#1 lore raw
Quoted 3 lines · Jeffy Chen

Add a sanity check before putting the cpu clk.

Fixes 2a6d1c6bcd1f (“arch_topology: Adjust initial CPU capacities with current freq")

Fixing a non-existent commit ?

--
Regards,
Sudeep

author
#2 lore raw

Hi Sudeep,

Quoted 7 lines · Sudeep Holla
Quoted 3 lines · Jeffy Chen

Add a sanity check before putting the cpu clk.

Fixes 2a6d1c6bcd1f (“arch_topology: Adjust initial CPU capacities with current freq")

Fixing a non-existent commit ?

Sorry, wrong commit id, will resend it soon.

Quoted 4 lines

--
Regards,
Sudeep

maintainer
#3 lore raw
In reply to Jeffy Chen
Quoted 3 lines · Jeffy Chen

Add a sanity check before putting the cpu clk.

Fixes 2a6d1c6bcd1f (“arch_topology: Adjust initial CPU capacities with current freq")

Don't you mean:

Fixes b8fe128dad8f ("arch_topology: Adjust initial CPU capacities with current freq")