All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>
Cc: Peng Hao <peng.hao2@zte.com.cn>, QEMU <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] vhost: fix a memory leak
Date: Wed, 5 Jul 2017 01:10:43 +0300	[thread overview]
Message-ID: <20170705010950-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CAJ+F1CKUnefwkRtSUXdabuM6Scvu3z1OUeVnug9PFzaqz=_eoA@mail.gmail.com>

On Tue, Jul 04, 2017 at 11:59:54PM +0200, Marc-André Lureau wrote:
> Hi
> 
> On Wed, Jul 5, 2017 at 12:33 AM, Peng Hao <peng.hao2@zte.com.cn> wrote:
> > vhost exists a call for g_file_get_contents, but not call g_free.
> >
> > Signed-off-by: Peng Hao<peng.hao2@zte.com.cn>
> 
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> mst: is this better?

That's fine, thanks!

> > ---
> >  hw/virtio/vhost-backend.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c
> > index 4e31de1..2c481d6 100644
> > --- a/hw/virtio/vhost-backend.c
> > +++ b/hw/virtio/vhost-backend.c
> > @@ -52,11 +52,13 @@ static int vhost_kernel_memslots_limit(struct vhost_dev *dev)
> >                              &s, NULL, NULL)) {
> >          uint64_t val = g_ascii_strtoull(s, NULL, 10);
> >          if (!((val == G_MAXUINT64 || !val) && errno)) {
> > +            g_free(s);
> >              return val;
> >          }
> >          error_report("ignoring invalid max_mem_regions value in vhost module:"
> >                       " %s", s);
> >      }
> > +    g_free(s);
> >      return limit;
> >  }
> >
> > --
> > 1.8.3.1
> >
> >
> >
> 
> 
> 
> -- 
> Marc-André Lureau

      reply	other threads:[~2017-07-04 22:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-04 22:33 [Qemu-devel] [PATCH] vhost: fix a memory leak Peng Hao
2017-07-04 14:21 ` Marc-André Lureau
2017-07-04 21:32   ` Michael S. Tsirkin
2017-07-04 21:59 ` Marc-André Lureau
2017-07-04 22:10   ` Michael S. Tsirkin [this message]

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=20170705010950-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=peng.hao2@zte.com.cn \
    --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.