diff options
author | Avi Kivity <avi@redhat.com> | 2010-12-16 05:16:34 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-12-16 05:39:31 -0500 |
commit | 3e26f23091da06d02fa62da14c95f3688d27857c (patch) | |
tree | 17ee88442a9a45a86a8bd8b69944a24ed041244a /arch/x86/kvm | |
parent | 73c1160ce377d8fc6d84cb630ebf9658808bec49 (diff) |
KVM: Fix preemption counter leak in kvm_timer_init()
Based on a patch from Thomas Meyer.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/x86.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index e3abd84750c7..b989e1f1e5d3 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -4564,9 +4564,11 @@ static void kvm_timer_init(void) | |||
4564 | #ifdef CONFIG_CPU_FREQ | 4564 | #ifdef CONFIG_CPU_FREQ |
4565 | struct cpufreq_policy policy; | 4565 | struct cpufreq_policy policy; |
4566 | memset(&policy, 0, sizeof(policy)); | 4566 | memset(&policy, 0, sizeof(policy)); |
4567 | cpufreq_get_policy(&policy, get_cpu()); | 4567 | cpu = get_cpu(); |
4568 | cpufreq_get_policy(&policy, cpu); | ||
4568 | if (policy.cpuinfo.max_freq) | 4569 | if (policy.cpuinfo.max_freq) |
4569 | max_tsc_khz = policy.cpuinfo.max_freq; | 4570 | max_tsc_khz = policy.cpuinfo.max_freq; |
4571 | put_cpu(); | ||
4570 | #endif | 4572 | #endif |
4571 | cpufreq_register_notifier(&kvmclock_cpufreq_notifier_block, | 4573 | cpufreq_register_notifier(&kvmclock_cpufreq_notifier_block, |
4572 | CPUFREQ_TRANSITION_NOTIFIER); | 4574 | CPUFREQ_TRANSITION_NOTIFIER); |