Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -968,7 +968,7 @@ long kvm_arch_vm_ioctl(struct file *filp,
			goto out;
		r = kvm_setup_default_irq_routing(kvm);
		if (r) {
			kfree(kvm->arch.vioapic);
			kvm_ioapic_destroy(kvm);
			goto out;
		}
		break;