diff options
Diffstat (limited to 'virt/kvm/kvm_main.c')
-rw-r--r-- | virt/kvm/kvm_main.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index bcf973ec98ff..14ec567816ab 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -550,16 +550,12 @@ static void kvm_destroy_dirty_bitmap(struct kvm_memory_slot *memslot) | |||
550 | static void kvm_free_physmem_slot(struct kvm_memory_slot *free, | 550 | static void kvm_free_physmem_slot(struct kvm_memory_slot *free, |
551 | struct kvm_memory_slot *dont) | 551 | struct kvm_memory_slot *dont) |
552 | { | 552 | { |
553 | if (!dont || free->rmap != dont->rmap) | ||
554 | vfree(free->rmap); | ||
555 | |||
556 | if (!dont || free->dirty_bitmap != dont->dirty_bitmap) | 553 | if (!dont || free->dirty_bitmap != dont->dirty_bitmap) |
557 | kvm_destroy_dirty_bitmap(free); | 554 | kvm_destroy_dirty_bitmap(free); |
558 | 555 | ||
559 | kvm_arch_free_memslot(free, dont); | 556 | kvm_arch_free_memslot(free, dont); |
560 | 557 | ||
561 | free->npages = 0; | 558 | free->npages = 0; |
562 | free->rmap = NULL; | ||
563 | } | 559 | } |
564 | 560 | ||
565 | void kvm_free_physmem(struct kvm *kvm) | 561 | void kvm_free_physmem(struct kvm *kvm) |
@@ -768,11 +764,7 @@ int __kvm_set_memory_region(struct kvm *kvm, | |||
768 | if (npages && !old.npages) { | 764 | if (npages && !old.npages) { |
769 | new.user_alloc = user_alloc; | 765 | new.user_alloc = user_alloc; |
770 | new.userspace_addr = mem->userspace_addr; | 766 | new.userspace_addr = mem->userspace_addr; |
771 | #ifndef CONFIG_S390 | 767 | |
772 | new.rmap = vzalloc(npages * sizeof(*new.rmap)); | ||
773 | if (!new.rmap) | ||
774 | goto out_free; | ||
775 | #endif /* not defined CONFIG_S390 */ | ||
776 | if (kvm_arch_create_memslot(&new, npages)) | 768 | if (kvm_arch_create_memslot(&new, npages)) |
777 | goto out_free; | 769 | goto out_free; |
778 | } | 770 | } |
@@ -831,7 +823,6 @@ int __kvm_set_memory_region(struct kvm *kvm, | |||
831 | 823 | ||
832 | /* actual memory is freed via old in kvm_free_physmem_slot below */ | 824 | /* actual memory is freed via old in kvm_free_physmem_slot below */ |
833 | if (!npages) { | 825 | if (!npages) { |
834 | new.rmap = NULL; | ||
835 | new.dirty_bitmap = NULL; | 826 | new.dirty_bitmap = NULL; |
836 | memset(&new.arch, 0, sizeof(new.arch)); | 827 | memset(&new.arch, 0, sizeof(new.arch)); |
837 | } | 828 | } |