[PATCH] KVM: ia64: clear kvm->arch.vioapic if fail to create irq chip

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If fail to create irq chip due to fail of kvm_setup_default_irq_routing(),
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: Wei Yongjun <yjwei@xxxxxxxxxxxxxx>
---
 arch/ia64/kvm/kvm-ia64.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c
index 0618898..0cfc15d 100644
--- a/arch/ia64/kvm/kvm-ia64.c
+++ b/arch/ia64/kvm/kvm-ia64.c
@@ -969,6 +969,7 @@ long kvm_arch_vm_ioctl(struct file *filp,
 		r = kvm_setup_default_irq_routing(kvm);
 		if (r) {
 			kfree(kvm->arch.vioapic);
+			kvm->arch.vioapic = NULL;
 			goto out;
 		}
 		break;
-- 
1.6.3.3


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux