diff options
author | Izik Eidus <ieidus@redhat.com> | 2009-07-28 20:26:58 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-09-10 07:33:20 +0200 |
commit | 3b80fffe2b31fb716d3ebe729c54464ee7856723 (patch) | |
tree | 9607efd950f70c279dba1e78506bbe9e5bb369bc /arch/x86/kvm/mmu.c | |
parent | KVM: remove superfluous NULL pointer check in kvm_inject_pit_timer_irqs() (diff) | |
download | linux-3b80fffe2b31fb716d3ebe729c54464ee7856723.tar.xz linux-3b80fffe2b31fb716d3ebe729c54464ee7856723.zip |
KVM: MMU: make __kvm_mmu_free_some_pages handle empty list
First check if the list is empty before attempting to look at list
entries.
Cc: stable@kernel.org
Signed-off-by: Izik Eidus <ieidus@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r-- | arch/x86/kvm/mmu.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 1249c12e1d5c..28be35c6ff1d 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -2705,7 +2705,8 @@ EXPORT_SYMBOL_GPL(kvm_mmu_unprotect_page_virt); void __kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu) { - while (vcpu->kvm->arch.n_free_mmu_pages < KVM_REFILL_PAGES) { + while (vcpu->kvm->arch.n_free_mmu_pages < KVM_REFILL_PAGES && + !list_empty(&vcpu->kvm->arch.active_mmu_pages)) { struct kvm_mmu_page *sp; sp = container_of(vcpu->kvm->arch.active_mmu_pages.prev, |