Skip to content

Commit 49243ad

Browse files
dhananjay-AMDvireshk
authored andcommitted
cpufreq/amd-pstate: Add the missing cpufreq_cpu_put()
Fix the reference counting of cpufreq_policy object in amd_pstate_update() function by adding the missing cpufreq_cpu_put(). Fixes: e8f555d ("cpufreq/amd-pstate: fix setting policy current frequency value") Signed-off-by: Dhananjay Ugwekar <[email protected]> Reviewed-by: Perry Yuan <[email protected]> Signed-off-by: Viresh Kumar <[email protected]>
1 parent 8174601 commit 49243ad

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,12 +554,15 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf,
554554
}
555555

556556
if (value == prev)
557-
return;
557+
goto cpufreq_policy_put;
558558

559559
WRITE_ONCE(cpudata->cppc_req_cached, value);
560560

561561
amd_pstate_update_perf(cpudata, min_perf, des_perf,
562562
max_perf, fast_switch);
563+
564+
cpufreq_policy_put:
565+
cpufreq_cpu_put(policy);
563566
}
564567

565568
static int amd_pstate_verify(struct cpufreq_policy_data *policy)

0 commit comments

Comments
 (0)