qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qom: cpu: destroy work_mutex in cpu_common_finalize
@ 2019-01-02  7:41 Li Qiang
  2019-01-02 10:55 ` Philippe Mathieu-Daudé
  2019-01-07 23:41 ` Paolo Bonzini
  0 siblings, 2 replies; 4+ messages in thread
From: Li Qiang @ 2019-01-02  7:41 UTC (permalink / raw)
  To: ehabkost, richard.henderson, imammedo, cota, philmd, pbonzini
  Cc: qemu-devel, Li Qiang

Commit 376692b9dc6(cpus: protect work list with work_mutex)
initialize a work_mutex in cpu_common_initfn, however forget
to destroy it. This will cause resource leak when hotunplug cpu
or hotplug cpu fails.

Signed-off-by: Li Qiang <liq3ea@163.com>
---
 qom/cpu.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/qom/cpu.c b/qom/cpu.c
index 9ad1372d57..367ebf9d61 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -380,6 +380,9 @@ static void cpu_common_initfn(Object *obj)
 
 static void cpu_common_finalize(Object *obj)
 {
+    CPUState *cpu = CPU(obj);
+
+    qemu_mutex_destroy(&cpu->work_mutex);
 }
 
 static int64_t cpu_common_get_arch_id(CPUState *cpu)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-10 11:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-02  7:41 [Qemu-devel] [PATCH] qom: cpu: destroy work_mutex in cpu_common_finalize Li Qiang
2019-01-02 10:55 ` Philippe Mathieu-Daudé
2019-01-07 23:41 ` Paolo Bonzini
2019-03-10 11:27   ` 李强

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).