KVM: Fix kvm_coalesced_mmio_ring duplicate allocation
authorSheng Yang <sheng@linux.intel.com>
Thu, 21 Jan 2010 08:20:04 +0000 (16:20 +0800)
committerMarcelo Tosatti <mtosatti@redhat.com>
Mon, 1 Mar 2010 15:36:03 +0000 (12:36 -0300)
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>
virt/kvm/kvm_main.c

index 7c5c873812ff8dc0a834a0694dd6dea079d0bae1..2b0974a148352c67838fd0bd6d6d9428e28c9f05 100644 (file)
@@ -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;
@@ -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;
        }