Skip to content

Commit

Permalink
KVM: Fix kvm_coalesced_mmio_ring duplicate allocation
Browse files Browse the repository at this point in the history
The commit 0953ca73 "KVM: Simplify coalesced mmio initialization"
allocate kvm_coalesced_mmio_ring in the kvm_coalesced_mmio_init(), but
didn't discard the original allocation...

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
  • Loading branch information
Sheng Yang authored and matosatti committed Mar 1, 2010
1 parent 727f5a2 commit f0f4b93
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions virt/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,6 @@ static struct kvm *kvm_create_vm(void)
{
int r = 0, i;
struct kvm *kvm = kvm_arch_create_vm();
#ifdef KVM_COALESCED_MMIO_PAGE_OFFSET
struct page *page;
#endif

if (IS_ERR(kvm))
goto out;
Expand Down Expand Up @@ -402,23 +399,9 @@ static struct kvm *kvm_create_vm(void)
}
}

#ifdef KVM_COALESCED_MMIO_PAGE_OFFSET
page = alloc_page(GFP_KERNEL | __GFP_ZERO);
if (!page) {
cleanup_srcu_struct(&kvm->srcu);
goto out_err;
}

kvm->coalesced_mmio_ring =
(struct kvm_coalesced_mmio_ring *)page_address(page);
#endif

r = kvm_init_mmu_notifier(kvm);
if (r) {
cleanup_srcu_struct(&kvm->srcu);
#ifdef KVM_COALESCED_MMIO_PAGE_OFFSET
put_page(page);
#endif
goto out_err;
}

Expand Down

0 comments on commit f0f4b93

Please sign in to comment.