提交 3e26f230 编写于 作者: A Avi Kivity

KVM: Fix preemption counter leak in kvm_timer_init()

Based on a patch from Thomas Meyer.
Signed-off-by: NAvi Kivity <avi@redhat.com>
上级 73c1160c
......@@ -4564,9 +4564,11 @@ static void kvm_timer_init(void)
#ifdef CONFIG_CPU_FREQ
struct cpufreq_policy policy;
memset(&policy, 0, sizeof(policy));
cpufreq_get_policy(&policy, get_cpu());
cpu = get_cpu();
cpufreq_get_policy(&policy, cpu);
if (policy.cpuinfo.max_freq)
max_tsc_khz = policy.cpuinfo.max_freq;
put_cpu();
#endif
cpufreq_register_notifier(&kvmclock_cpufreq_notifier_block,
CPUFREQ_TRANSITION_NOTIFIER);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册