diff options
author | Li Qiang <liq3ea@163.com> | 2019-01-01 23:41:14 -0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-03-11 16:55:51 +0100 |
commit | 611dbe46093d901cf01c1b252dd39441b95d1c35 (patch) | |
tree | 3958cbf8847c85af8213fec55b1c5ae7ff84acff | |
parent | 494d199727ba248c96326b4e1c97f86eb11a5ec7 (diff) |
qom: cpu: destroy work_mutex in cpu_common_finalize
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>
Message-Id: <20190102074114.26988-1-liq3ea@163.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | qom/cpu.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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) |