From: Li Qiang <liq3ea@163.com>
To: ehabkost@redhat.com, richard.henderson@linaro.org,
imammedo@redhat.com, cota@braap.org, philmd@redhat.com,
pbonzini@redhat.com
Cc: qemu-devel@nongnu.org, Li Qiang <liq3ea@163.com>
Subject: [Qemu-devel] [PATCH] qom: cpu: destroy work_mutex in cpu_common_finalize
Date: Tue, 1 Jan 2019 23:41:14 -0800 [thread overview]
Message-ID: <20190102074114.26988-1-liq3ea@163.com> (raw)
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
next reply other threads:[~2019-01-02 7:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-02 7:41 Li Qiang [this message]
2019-01-02 10:55 ` [Qemu-devel] [PATCH] qom: cpu: destroy work_mutex in cpu_common_finalize Philippe Mathieu-Daudé
2019-01-07 23:41 ` Paolo Bonzini
2019-03-10 11:27 ` 李强
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190102074114.26988-1-liq3ea@163.com \
--to=liq3ea@163.com \
--cc=cota@braap.org \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).