2010-08-13 08:23:33

by Xiaotian Feng

[permalink] [raw]
Subject: [PATCH] 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]>
---
arch/x86/kvm/i8254.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
index 0fd6378..f539c3c 100644
--- a/arch/x86/kvm/i8254.c
+++ b/arch/x86/kvm/i8254.c
@@ -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;
}
--
1.7.2.1


2010-08-15 16:13:31

by Avi Kivity

[permalink] [raw]
Subject: Re: [PATCH] kvm: destroy workqueue on kvm_create_pit() failures

On 08/13/2010 11:23 AM, Xiaotian Feng wrote:
> kernel needs to destroy workqueue if kvm_create_pit() fails, otherwise
> after pit is freed, the workqueue is leaked.

Applied, thanks.

--
error compiling committee.c: too many arguments to function