All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Li Qiang <liq3ea@gmail.com>,
	qemu-devel@nongnu.org, Li Qiang <liqiang6-s@360.cn>
Subject: Re: [Qemu-devel] [PATCH] serial: fix memory leak in serial exit
Date: Wed, 4 Jan 2017 15:24:12 +0200	[thread overview]
Message-ID: <20170104152329-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <7a63340c-2fd8-f5ec-c39c-8958b9582752@redhat.com>

On Wed, Jan 04, 2017 at 12:43:35PM +0100, Paolo Bonzini wrote:
> 
> 
> On 04/01/2017 09:43, Li Qiang wrote:
> > From: Li Qiang <liqiang6-s@360.cn>
> > 
> > The serial_exit_core function doesn't free some resources.
> > This can lead memory leak when hotplug and unplug. This
> > patch avoid this.
> > 
> > Signed-off-by: Li Qiang <liqiang6-s@360.cn>
> > ---
> >  hw/char/serial.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/hw/char/serial.c b/hw/char/serial.c
> > index ffbacd8..67b18ed 100644
> > --- a/hw/char/serial.c
> > +++ b/hw/char/serial.c
> > @@ -906,6 +906,16 @@ void serial_realize_core(SerialState *s, Error **errp)
> >  void serial_exit_core(SerialState *s)
> >  {
> >      qemu_chr_fe_deinit(&s->chr);
> > +
> > +    timer_del(s->modem_status_poll);
> > +    timer_free(s->modem_status_poll);
> > +
> > +    timer_del(s->fifo_timeout_timer);
> > +    timer_free(s->fifo_timeout_timer);
> > +
> > +    fifo8_destroy(&s->recv_fifo);
> > +    fifo8_destroy(&s->xmit_fifo);
> > +
> >      qemu_unregister_reset(serial_reset, s);
> >  }
> >  
> > 
> 
> Thanks, looks good.
> 
> Paolo


Paolo, so are you merging this?

Acked-by: Michael S. Tsirkin <mst@redhat.com>
-- 
MST

  reply	other threads:[~2017-01-04 13:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-04  8:43 [Qemu-devel] [PATCH] serial: fix memory leak in serial exit Li Qiang
2017-01-04 11:43 ` Paolo Bonzini
2017-01-04 13:24   ` Michael S. Tsirkin [this message]
2017-01-05 10:17     ` Paolo Bonzini

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=20170104152329-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=liq3ea@gmail.com \
    --cc=liqiang6-s@360.cn \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.