|
|
4d7edd7 |
From: Li Qiang <liqiang6-s@360.cn>
|
|
|
4d7edd7 |
Date: Sun, 18 Sep 2016 19:07:11 -0700
|
|
|
4d7edd7 |
Subject: [PATCH] virtio-gpu: fix memory leak in virtio_gpu_resource_create_2d
|
|
|
4d7edd7 |
MIME-Version: 1.0
|
|
|
4d7edd7 |
Content-Type: text/plain; charset=UTF-8
|
|
|
4d7edd7 |
Content-Transfer-Encoding: 8bit
|
|
|
4d7edd7 |
|
|
|
4d7edd7 |
In virtio gpu resource create dispatch, if the pixman format is zero
|
|
|
4d7edd7 |
it doesn't free the resource object allocated previously. Thus leading
|
|
|
4d7edd7 |
a host memory leak issue. This patch avoid this.
|
|
|
4d7edd7 |
|
|
|
4d7edd7 |
Signed-off-by: Li Qiang <liqiang6-s@360.cn>
|
|
|
4d7edd7 |
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
4d7edd7 |
Message-id: 57df486e.8379240a.c3620.ff81@mx.google.com
|
|
|
4d7edd7 |
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
4d7edd7 |
(cherry picked from commit cb3a0522b694cc5bb6424497b3f828ccd28fd1dd)
|
|
|
4d7edd7 |
---
|
|
|
4d7edd7 |
hw/display/virtio-gpu.c | 1 +
|
|
|
4d7edd7 |
1 file changed, 1 insertion(+)
|
|
|
4d7edd7 |
|
|
|
4d7edd7 |
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
|
|
|
4d7edd7 |
index c181fb3..d345276 100644
|
|
|
4d7edd7 |
--- a/hw/display/virtio-gpu.c
|
|
|
4d7edd7 |
+++ b/hw/display/virtio-gpu.c
|
|
|
4d7edd7 |
@@ -323,6 +323,7 @@ static void virtio_gpu_resource_create_2d(VirtIOGPU *g,
|
|
|
4d7edd7 |
qemu_log_mask(LOG_GUEST_ERROR,
|
|
|
4d7edd7 |
"%s: host couldn't handle guest format %d\n",
|
|
|
4d7edd7 |
__func__, c2d.format);
|
|
|
4d7edd7 |
+ g_free(res);
|
|
|
4d7edd7 |
cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER;
|
|
|
4d7edd7 |
return;
|
|
|
4d7edd7 |
}
|