]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 13:01:46 +0000 (14:01 +0100)
commit d364eee14c682b141f4667efc3c65191339d88bd upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/cpufreq/amd-pstate.c

index bdfd8ffe04398c39b51add4bd1ef3d61e0554d8b..9db5354fdb0271886eed548f978fa985afe5c913 100644 (file)
@@ -796,8 +796,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);
@@ -807,8 +809,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)