public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] KVM: kvm->arch.vioapic should be NULL if kvm_ioapic_init() failure
@ 2010-02-09  2:31 Wei Yongjun
  2010-02-09  2:33 ` [PATCH 2/4] KVM: cleanup the failure path of KVM_CREATE_IRQCHIP ioctrl Wei Yongjun
  2010-02-09 10:46 ` [PATCH 1/4] KVM: kvm->arch.vioapic should be NULL if kvm_ioapic_init() failure Avi Kivity
  0 siblings, 2 replies; 5+ messages in thread
From: Wei Yongjun @ 2010-02-09  2:31 UTC (permalink / raw)
  To: kvm; +Cc: Marcelo Tosatti

kvm->arch.vioapic should be NULL in case of kvm_ioapic_init() failure
due to cannot register io dev.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 virt/kvm/ioapic.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c
index a2edfd1..f3d0693 100644
--- a/virt/kvm/ioapic.c
+++ b/virt/kvm/ioapic.c
@@ -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;
 }
-- 
1.6.3.3



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-02-09 10:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-09  2:31 [PATCH 1/4] KVM: kvm->arch.vioapic should be NULL if kvm_ioapic_init() failure Wei Yongjun
2010-02-09  2:33 ` [PATCH 2/4] KVM: cleanup the failure path of KVM_CREATE_IRQCHIP ioctrl Wei Yongjun
2010-02-09  2:39   ` [PATCH 3/4] KVM: PIT: unregister kvm irq notifier if fail to create pit Wei Yongjun
2010-02-09  2:41     ` [PATCH 4/4] KVM: ia64: destroy ioapic device if fail to setup default irq routing Wei Yongjun
2010-02-09 10:46 ` [PATCH 1/4] KVM: kvm->arch.vioapic should be NULL if kvm_ioapic_init() failure Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox