qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@gmail.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: [Qemu-devel] [PATCH v2 3/6] virtio-gpu: fix memory leak in error path
Date: Fri, 22 Jan 2016 13:23:44 +0100	[thread overview]
Message-ID: <1453465427-6961-4-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1453465427-6961-1-git-send-email-kraxel@redhat.com>

Found by Coverity Scan, buf not freed on error.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 hw/display/virtio-gpu-3d.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/display/virtio-gpu-3d.c b/hw/display/virtio-gpu-3d.c
index 28dccfd..d2af327 100644
--- a/hw/display/virtio-gpu-3d.c
+++ b/hw/display/virtio-gpu-3d.c
@@ -197,7 +197,7 @@ static void virgl_cmd_submit_3d(VirtIOGPU *g,
         qemu_log_mask(LOG_GUEST_ERROR, "%s: size mismatch (%zd/%d)",
                       __func__, s, cs.size);
         cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER;
-        return;
+        goto out;
     }
 
     if (virtio_gpu_stats_enabled(g->conf)) {
@@ -207,6 +207,7 @@ static void virgl_cmd_submit_3d(VirtIOGPU *g,
 
     virgl_renderer_submit_cmd(buf, cs.hdr.ctx_id, cs.size / 4);
 
+out:
     g_free(buf);
 }
 
-- 
1.8.3.1

  parent reply	other threads:[~2016-01-22 12:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-22 12:23 [Qemu-devel] [PATCH v2 0/6] virtio-gpu: fixes and spice preparation Gerd Hoffmann
2016-01-22 12:23 ` [Qemu-devel] [PATCH v2 1/6] zap qemu_egl_has_ext in include/ui/egl-helpers.h Gerd Hoffmann
2016-01-22 12:23 ` [Qemu-devel] [PATCH v2 2/6] console: block rendering until client is done Gerd Hoffmann
2016-01-22 12:23 ` Gerd Hoffmann [this message]
2016-01-22 12:23 ` [Qemu-devel] [PATCH v2 4/6] virtio-gpu: maintain command queue Gerd Hoffmann
2016-01-22 12:23 ` [Qemu-devel] [PATCH v2 5/6] virtio-gpu: add support to enable/disable command processing Gerd Hoffmann
2016-01-22 12:23 ` [Qemu-devel] [PATCH v2 6/6] virtio-gpu: block any rendering until client (ui) is done Gerd Hoffmann

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=1453465427-6961-4-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=marcandre.lureau@gmail.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 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).