Skip to content

Commit 3185bf8

Browse files
Xiaotian Fengavikivity
authored andcommitted
KVM: destroy workqueue on kvm_create_pit() failures
kernel needs to destroy workqueue if kvm_create_pit() fails, otherwise after pit is freed, the workqueue is leaked. Signed-off-by: Xiaotian Feng <[email protected]> Cc: Avi Kivity <[email protected]> Cc: Marcelo Tosatti <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Gleb Natapov <[email protected]> Cc: "Michael S. Tsirkin" <[email protected]> Cc: Gregory Haskins <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
1 parent f45755b commit 3185bf8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kvm/i8254.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ struct kvm_pit *kvm_create_pit(struct kvm *kvm, u32 flags)
742742
kvm_unregister_irq_mask_notifier(kvm, 0, &pit->mask_notifier);
743743
kvm_unregister_irq_ack_notifier(kvm, &pit_state->irq_ack_notifier);
744744
kvm_free_irq_source_id(kvm, pit->irq_source_id);
745-
745+
destroy_workqueue(pit->wq);
746746
kfree(pit);
747747
return NULL;
748748
}

0 commit comments

Comments
 (0)