Skip to contentSkip to conversation

kvm: destroy workqueue on kvm_create_pit() failures

PATCH Applied Xiaotian Feng 2 participants 2 messages Aug 13, 2010 – Aug 15, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

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]>
---
 arch/x86/kvm/i8254.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kvm/i8254.c +1 -1
index 0fd6378..f539c3c 100644
@@ -742,7 +742,7 @@ fail:
 	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);
-
+	destroy_workqueue(pit->wq);
 	kfree(pit);
 	return NULL;
 }
Signature · 1 line
1.7.2.1
Applied
#1 lore raw
Quoted 2 lines · Xiaotian Feng

kernel needs to destroy workqueue if kvm_create_pit() fails, otherwise after pit is freed, the workqueue is leaked.

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function