Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e48bb497 authored by Avi Kivity's avatar Avi Kivity
Browse files

KVM: MMU: Fix memory leak on guest demand faults



While backporting 72dc67a6, a gfn_to_page()
call was duplicated instead of moved (due to an unrelated patch not being
present in mainline).  This caused a page reference leak, resulting in a
fairly massive memory leak.

Fix by removing the extraneous gfn_to_page() call.

Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
parent 707a18a5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1412,7 +1412,7 @@ static void mmu_guess_page_from_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
	up_read(&current->mm->mmap_sem);

	vcpu->arch.update_pte.gfn = gfn;
	vcpu->arch.update_pte.page = gfn_to_page(vcpu->kvm, gfn);
	vcpu->arch.update_pte.page = page;
}

void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,