Skip to content

Commit a2d0230

Browse files
srikardmpe
authored andcommitted
cpufreq: powernv: Fix frame-size-overflow in powernv_cpufreq_reboot_notifier
The patch avoids allocating cpufreq_policy on stack hence fixing frame size overflow in 'powernv_cpufreq_reboot_notifier': drivers/cpufreq/powernv-cpufreq.c: In function powernv_cpufreq_reboot_notifier: drivers/cpufreq/powernv-cpufreq.c:906:1: error: the frame size of 2064 bytes is larger than 2048 bytes Fixes: cf30af7 ("cpufreq: powernv: Set the cpus to nominal frequency during reboot/kexec") Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Reviewed-by: Daniel Axtens <dja@axtens.net> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20200922080254.41497-1-srikar@linux.vnet.ibm.com
1 parent 9686e43 commit a2d0230

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

drivers/cpufreq/powernv-cpufreq.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -885,12 +885,15 @@ static int powernv_cpufreq_reboot_notifier(struct notifier_block *nb,
885885
unsigned long action, void *unused)
886886
{
887887
int cpu;
888-
struct cpufreq_policy cpu_policy;
888+
struct cpufreq_policy *cpu_policy;
889889

890890
rebooting = true;
891891
for_each_online_cpu(cpu) {
892-
cpufreq_get_policy(&cpu_policy, cpu);
893-
powernv_cpufreq_target_index(&cpu_policy, get_nominal_index());
892+
cpu_policy = cpufreq_cpu_get(cpu);
893+
if (!cpu_policy)
894+
continue;
895+
powernv_cpufreq_target_index(cpu_policy, get_nominal_index());
896+
cpufreq_cpu_put(cpu_policy);
894897
}
895898

896899
return NOTIFY_DONE;

0 commit comments

Comments
 (0)