mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 12:16:20 +00:00
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>
This commit is contained in:
parent
95fb4eb698
commit
3b80fffe2b
1 changed files with 2 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue