提交 1ae77bad 编写于 作者: W Wei Yongjun 提交者: Marcelo Tosatti

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: NWei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: NAvi Kivity <avi@redhat.com>
上级 d225f53b
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册