KVM: x86: use pic/ioapic destructor when destroy vm
authorPeter Xu <peterx@redhat.com>
Wed, 15 Mar 2017 08:01:19 +0000 (16:01 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 23 Mar 2017 18:02:06 +0000 (19:02 +0100)
We have specific destructors for pic/ioapic, we'd better use them when
destroying the VM as well.

Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/x86.c

index 1faf620a6fdc206705a03357d3a8ec5814b2c790..d30ff491ecc76284f697d104674c8587572758ac 100644 (file)
@@ -8153,8 +8153,8 @@ void kvm_arch_destroy_vm(struct kvm *kvm)
        if (kvm_x86_ops->vm_destroy)
                kvm_x86_ops->vm_destroy(kvm);
        kvm_iommu_unmap_guest(kvm);
-       kfree(kvm->arch.vpic);
-       kfree(kvm->arch.vioapic);
+       kvm_pic_destroy(kvm);
+       kvm_ioapic_destroy(kvm);
        kvm_free_vcpus(kvm);
        kvfree(rcu_dereference_check(kvm->arch.apic_map, 1));
        kvm_mmu_uninit_vm(kvm);