mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
KVM: kvm->arch.vioapic should be NULL if kvm_ioapic_init() failure
kvm->arch.vioapic should be NULL in case of kvm_ioapic_init() failure due to cannot register io dev. Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
This commit is contained in:
parent
d225f53b76
commit
1ae77badc2
1 changed files with 3 additions and 1 deletions
|
|
@ -393,8 +393,10 @@ int kvm_ioapic_init(struct kvm *kvm)
|
|||
mutex_lock(&kvm->slots_lock);
|
||||
ret = kvm_io_bus_register_dev(kvm, KVM_MMIO_BUS, &ioapic->dev);
|
||||
mutex_unlock(&kvm->slots_lock);
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
kvm->arch.vioapic = NULL;
|
||||
kfree(ioapic);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue