diff options
| author | Sheng Yang <sheng@linux.intel.com> | 2010-01-21 03:20:04 -0500 |
|---|---|---|
| committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-03-01 10:36:03 -0500 |
| commit | f0f4b930900ffa8daddb5262522c3e5c67ee1835 (patch) | |
| tree | 1188f9b05fe66d15eb42ac47ca7b1f1a5fe52d31 /virt | |
| parent | 727f5a23e2080b19da392f17fa3158a0941f81f5 (diff) | |
KVM: Fix kvm_coalesced_mmio_ring duplicate allocation
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>
Diffstat (limited to 'virt')
| -rw-r--r-- | virt/kvm/kvm_main.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 7c5c873812ff..2b0974a14835 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
| @@ -371,9 +371,6 @@ static struct kvm *kvm_create_vm(void) | |||
| 371 | { | 371 | { |
| 372 | int r = 0, i; | 372 | int r = 0, i; |
| 373 | struct kvm *kvm = kvm_arch_create_vm(); | 373 | struct kvm *kvm = kvm_arch_create_vm(); |
| 374 | #ifdef KVM_COALESCED_MMIO_PAGE_OFFSET | ||
| 375 | struct page *page; | ||
| 376 | #endif | ||
| 377 | 374 | ||
| 378 | if (IS_ERR(kvm)) | 375 | if (IS_ERR(kvm)) |
| 379 | goto out; | 376 | goto out; |
| @@ -402,23 +399,9 @@ static struct kvm *kvm_create_vm(void) | |||
| 402 | } | 399 | } |
| 403 | } | 400 | } |
| 404 | 401 | ||
| 405 | #ifdef KVM_COALESCED_MMIO_PAGE_OFFSET | ||
| 406 | page = alloc_page(GFP_KERNEL | __GFP_ZERO); | ||
| 407 | if (!page) { | ||
| 408 | cleanup_srcu_struct(&kvm->srcu); | ||
| 409 | goto out_err; | ||
| 410 | } | ||
| 411 | |||
| 412 | kvm->coalesced_mmio_ring = | ||
| 413 | (struct kvm_coalesced_mmio_ring *)page_address(page); | ||
| 414 | #endif | ||
| 415 | |||
| 416 | r = kvm_init_mmu_notifier(kvm); | 402 | r = kvm_init_mmu_notifier(kvm); |
| 417 | if (r) { | 403 | if (r) { |
| 418 | cleanup_srcu_struct(&kvm->srcu); | 404 | cleanup_srcu_struct(&kvm->srcu); |
| 419 | #ifdef KVM_COALESCED_MMIO_PAGE_OFFSET | ||
| 420 | put_page(page); | ||
| 421 | #endif | ||
| 422 | goto out_err; | 405 | goto out_err; |
| 423 | } | 406 | } |
| 424 | 407 | ||
