From: Wei Yongjun Date: Mon, 8 Feb 2010 09:03:51 +0000 (+0800) Subject: KVM: PIT: unregister kvm irq notifier if fail to create pit X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d225f53b76f4287365efd381b9e3a732e6bad27e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git KVM: PIT: unregister kvm irq notifier if fail to create pit If fail to create pit, we should unregister kvm irq notifier which register in kvm_create_pit(). Signed-off-by: Wei Yongjun Acked-by: Marcelo Tosatti Signed-off-by: Avi Kivity --- diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index 6a74246f80c6..c9569f20dfba 100644 --- a/arch/x86/kvm/i8254.c +++ b/arch/x86/kvm/i8254.c @@ -663,8 +663,9 @@ fail_unregister: kvm_io_bus_unregister_dev(kvm, KVM_PIO_BUS, &pit->dev); fail: - if (pit->irq_source_id >= 0) - kvm_free_irq_source_id(kvm, pit->irq_source_id); + kvm_unregister_irq_mask_notifier(kvm, 0, &pit->mask_notifier); + kvm_unregister_irq_ack_notifier(kvm, &pit_state->irq_ack_notifier); + kvm_free_irq_source_id(kvm, pit->irq_source_id); kfree(pit); return NULL;