aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index bd3161c6daed..b2f91b9af00d 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2771,6 +2771,8 @@ long kvm_arch_vm_ioctl(struct file *filp,
2771 if (vpic) { 2771 if (vpic) {
2772 r = kvm_ioapic_init(kvm); 2772 r = kvm_ioapic_init(kvm);
2773 if (r) { 2773 if (r) {
2774 kvm_io_bus_unregister_dev(kvm, KVM_PIO_BUS,
2775 &vpic->dev);
2774 kfree(vpic); 2776 kfree(vpic);
2775 goto create_irqchip_unlock; 2777 goto create_irqchip_unlock;
2776 } 2778 }
@@ -2782,10 +2784,8 @@ long kvm_arch_vm_ioctl(struct file *filp,
2782 r = kvm_setup_default_irq_routing(kvm); 2784 r = kvm_setup_default_irq_routing(kvm);
2783 if (r) { 2785 if (r) {
2784 mutex_lock(&kvm->irq_lock); 2786 mutex_lock(&kvm->irq_lock);
2785 kfree(kvm->arch.vpic); 2787 kvm_ioapic_destroy(kvm);
2786 kfree(kvm->arch.vioapic); 2788 kvm_destroy_pic(kvm);
2787 kvm->arch.vpic = NULL;
2788 kvm->arch.vioapic = NULL;
2789 mutex_unlock(&kvm->irq_lock); 2789 mutex_unlock(&kvm->irq_lock);
2790 } 2790 }
2791 create_irqchip_unlock: 2791 create_irqchip_unlock: