diff options
-rw-r--r-- | virt/kvm/ioapic.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c index a2edfd177faf..f3d06934ae6d 100644 --- a/virt/kvm/ioapic.c +++ b/virt/kvm/ioapic.c | |||
@@ -393,8 +393,10 @@ int kvm_ioapic_init(struct kvm *kvm) | |||
393 | mutex_lock(&kvm->slots_lock); | 393 | mutex_lock(&kvm->slots_lock); |
394 | ret = kvm_io_bus_register_dev(kvm, KVM_MMIO_BUS, &ioapic->dev); | 394 | ret = kvm_io_bus_register_dev(kvm, KVM_MMIO_BUS, &ioapic->dev); |
395 | mutex_unlock(&kvm->slots_lock); | 395 | mutex_unlock(&kvm->slots_lock); |
396 | if (ret < 0) | 396 | if (ret < 0) { |
397 | kvm->arch.vioapic = NULL; | ||
397 | kfree(ioapic); | 398 | kfree(ioapic); |
399 | } | ||
398 | 400 | ||
399 | return ret; | 401 | return ret; |
400 | } | 402 | } |