KVM: PIT: free irq source id in handling error path
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Tue, 17 Aug 2010 07:02:12 +0000 (15:02 +0800)
committerAvi Kivity <avi@redhat.com>
Tue, 17 Aug 2010 09:04:23 +0000 (12:04 +0300)
Free irq source id if create pit workqueue fail

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/i8254.c

index f539c3c..ddeb231 100644 (file)
@@ -697,6 +697,7 @@ struct kvm_pit *kvm_create_pit(struct kvm *kvm, u32 flags)
        pit->wq = create_singlethread_workqueue("kvm-pit-wq");
        if (!pit->wq) {
                mutex_unlock(&pit->pit_state.lock);
+               kvm_free_irq_source_id(kvm, pit->irq_source_id);
                kfree(pit);
                return NULL;
        }