aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kvm
diff options
context:
space:
mode:
authorWei Yongjun <yjwei@cn.fujitsu.com>2010-02-08 21:41:56 -0500
committerMarcelo Tosatti <mtosatti@redhat.com>2010-03-01 10:36:10 -0500
commit4b7bb9210047fe880bb71e6273c3a4526799dbd7 (patch)
treeca3de4c61fa42b4a09930646741d5cd17c194379 /arch/ia64/kvm
parent72bb2fcd23afe8db53b47e8f9edd736c517ba532 (diff)
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: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/ia64/kvm')
-rw-r--r--arch/ia64/kvm/kvm-ia64.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c
index 06188988ed27..26e0e089bfe7 100644
--- a/arch/ia64/kvm/kvm-ia64.c
+++ b/arch/ia64/kvm/kvm-ia64.c
@@ -968,7 +968,7 @@ long kvm_arch_vm_ioctl(struct file *filp,
968 goto out; 968 goto out;
969 r = kvm_setup_default_irq_routing(kvm); 969 r = kvm_setup_default_irq_routing(kvm);
970 if (r) { 970 if (r) {
971 kfree(kvm->arch.vioapic); 971 kvm_ioapic_destroy(kvm);
972 goto out; 972 goto out;
973 } 973 }
974 break; 974 break;