Commit 4b7bb921 authored by Wei Yongjun's avatar Wei Yongjun Committed by Marcelo Tosatti

KVM: ia64: destroy ioapic device if fail to setup default irq routing

If KVM_CREATE_IRQCHIP fail due to kvm_setup_default_irq_routing(),
ioapic device is not destroyed and kvm->arch.vioapic is not set to
NULL, this may cause KVM_GET_IRQCHIP and KVM_SET_IRQCHIP access to
unexcepted memory.
Signed-off-by: default avatarWei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 72bb2fcd
...@@ -968,7 +968,7 @@ long kvm_arch_vm_ioctl(struct file *filp, ...@@ -968,7 +968,7 @@ long kvm_arch_vm_ioctl(struct file *filp,
goto out; goto out;
r = kvm_setup_default_irq_routing(kvm); r = kvm_setup_default_irq_routing(kvm);
if (r) { if (r) {
kfree(kvm->arch.vioapic); kvm_ioapic_destroy(kvm);
goto out; goto out;
} }
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment