From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Li Qiang <liq3ea@163.com>,
ehabkost@redhat.com, richard.henderson@linaro.org,
imammedo@redhat.com, cota@braap.org, pbonzini@redhat.com
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qom: cpu: destroy work_mutex in cpu_common_finalize
Date: Wed, 2 Jan 2019 11:55:02 +0100 [thread overview]
Message-ID: <64cb4e3a-2bb6-1aba-d91b-426a132b0038@redhat.com> (raw)
In-Reply-To: <20190102074114.26988-1-liq3ea@163.com>
On 1/2/19 8:41 AM, Li Qiang wrote:
> 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.
>
Long standing leak ;)
Maybe add:
Fixes: 376692b9dc6
> Signed-off-by: Li Qiang <liq3ea@163.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.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)
>
next prev parent reply other threads:[~2019-01-02 10:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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é [this message]
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=64cb4e3a-2bb6-1aba-d91b-426a132b0038@redhat.com \
--to=philmd@redhat.com \
--cc=cota@braap.org \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=liq3ea@163.com \
--cc=pbonzini@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).