All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@gmail.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: QEMU <qemu-devel@nongnu.org>, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH] vhost-user-gpu: reorder free calls.
Date: Fri, 4 Jun 2021 14:39:46 +0400	[thread overview]
Message-ID: <CAJ+F1CKR6zxikG0_E5p+Pd=LYYLArQ6tUvWo9VTJ0TpOG0LH0Q@mail.gmail.com> (raw)
In-Reply-To: <20210604103714.1237414-1-kraxel@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1086 bytes --]

On Fri, Jun 4, 2021 at 2:38 PM Gerd Hoffmann <kraxel@redhat.com> wrote:

> Free in correct order to avoid use-after-free.
>
> Resolves: CID 1453812
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

---
>  contrib/vhost-user-gpu/vhost-user-gpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/contrib/vhost-user-gpu/vhost-user-gpu.c
> b/contrib/vhost-user-gpu/vhost-user-gpu.c
> index 6dc6a44f4e26..611360e6b475 100644
> --- a/contrib/vhost-user-gpu/vhost-user-gpu.c
> +++ b/contrib/vhost-user-gpu/vhost-user-gpu.c
> @@ -350,8 +350,8 @@ vg_resource_create_2d(VuGpu *g,
>      if (!res->image) {
>          g_critical("%s: resource creation failed %d %d %d",
>                     __func__, c2d.resource_id, c2d.width, c2d.height);
> -        g_free(res);
>          vugbm_buffer_destroy(&res->buffer);
> +        g_free(res);
>          cmd->error = VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY;
>          return;
>      }
> --
> 2.31.1
>
>
>

-- 
Marc-André Lureau

[-- Attachment #2: Type: text/html, Size: 1866 bytes --]

  reply	other threads:[~2021-06-04 10:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-04 10:37 [PATCH] vhost-user-gpu: reorder free calls Gerd Hoffmann
2021-06-04 10:39 ` Marc-André Lureau [this message]
2021-06-04 10:39 ` Philippe Mathieu-Daudé
2021-06-05 12:19 ` Li Qiang

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='CAJ+F1CKR6zxikG0_E5p+Pd=LYYLArQ6tUvWo9VTJ0TpOG0LH0Q@mail.gmail.com' \
    --to=marcandre.lureau@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=mst@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.