From: Dirk Brandewie Date: Mon, 24 Mar 2014 14:41:29 +0000 (-0700) Subject: intel_pstate: Use del_timer_sync in intel_pstate_cpu_stop X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c2294a2f7853e6450361d078b65407bdaa6d1d11;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git intel_pstate: Use del_timer_sync in intel_pstate_cpu_stop Ensure that no timer callback is running since we are about to free the timer structure. We cannot guarantee that the call back is called on the CPU where the timer is running. Reported-by: Thomas Gleixner Signed-off-by: Dirk Brandewie Reviewed-by: Srivatsa S. Bhat Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index bcb9a6d0ae11..099967302bf2 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -778,7 +778,7 @@ static void intel_pstate_stop_cpu(struct cpufreq_policy *policy) pr_info("intel_pstate CPU %d exiting\n", cpu_num); - del_timer(&all_cpu_data[cpu_num]->timer); + del_timer_sync(&all_cpu_data[cpu_num]->timer); intel_pstate_set_pstate(cpu, cpu->pstate.min_pstate); kfree(all_cpu_data[cpu_num]); all_cpu_data[cpu_num] = NULL;