qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Li Qiang <liq3ea@163.com>,
	ehabkost@redhat.com, richard.henderson@linaro.org,
	imammedo@redhat.com, cota@braap.org, philmd@redhat.com
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qom: cpu: destroy work_mutex in cpu_common_finalize
Date: Tue, 8 Jan 2019 00:41:09 +0100	[thread overview]
Message-ID: <a697a5a0-54e5-0a2f-8d6c-e204a095ff6c@redhat.com> (raw)
In-Reply-To: <20190102074114.26988-1-liq3ea@163.com>

On 02/01/19 08:41, 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.
> 
> 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)
> 

Queued, thanks.

Paolo

  parent reply	other threads:[~2019-01-07 23:41 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é
2019-01-07 23:41 ` Paolo Bonzini [this message]
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=a697a5a0-54e5-0a2f-8d6c-e204a095ff6c@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=cota@braap.org \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=liq3ea@163.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).