]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cpufreq/amd-pstate: Remove the goto label in amd_pstate_update_limits
authorDhananjay Ugwekar <dhananjay.ugwekar@amd.com>
Wed, 5 Feb 2025 11:25:12 +0000 (11:25 +0000)
committerMario Limonciello <mario.limonciello@amd.com>
Wed, 5 Feb 2025 18:18:27 +0000 (12:18 -0600)
Scope based guard/cleanup macros should not be used together with goto
labels. Hence, remove the goto label.

Fixes: 6c093d5a5b73 ("cpufreq/amd-pstate: convert mutex use to guard()")
Signed-off-by: Dhananjay Ugwekar <dhananjay.ugwekar@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20250205112523.201101-2-dhananjay.ugwekar@amd.com
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
drivers/cpufreq/amd-pstate.c

index 7120f035c0be454f3a6fe9867f33d723e798c5e6..b163c16998218b6a48743c5b2de98658a8932a23 100644 (file)
@@ -838,8 +838,10 @@ static void amd_pstate_update_limits(unsigned int cpu)
        guard(mutex)(&amd_pstate_driver_lock);
 
        ret = amd_get_highest_perf(cpu, &cur_high);
-       if (ret)
-               goto free_cpufreq_put;
+       if (ret) {
+               cpufreq_cpu_put(policy);
+               return;
+       }
 
        prev_high = READ_ONCE(cpudata->prefcore_ranking);
        highest_perf_changed = (prev_high != cur_high);
@@ -849,8 +851,6 @@ static void amd_pstate_update_limits(unsigned int cpu)
                if (cur_high < CPPC_MAX_PERF)
                        sched_set_itmt_core_prio((int)cur_high, cpu);
        }
-
-free_cpufreq_put:
        cpufreq_cpu_put(policy);
 
        if (!highest_perf_changed)