From: Li Qiang <liq3ea@gmail.com>
To: kraxel@redhat.com, marcandre.lureau@gmail.com, qemu-devel@nongnu.org
Cc: liqiang6-s@360.cn, Li Qiang <liq3ea@gmail.com>
Subject: [Qemu-devel] [PATCH 2/2] virtio-gpu: call cleanup mapping function in resource destroy
Date: Thu, 24 Nov 2016 07:30:09 -0500 [thread overview]
Message-ID: <1479990609-28243-3-git-send-email-liq3ea@gmail.com> (raw)
In-Reply-To: <1479990609-28243-1-git-send-email-liq3ea@gmail.com>
If the guest destroy the resource before detach banking, the 'iov'
and 'addrs' field in resource is not freed thus leading memory
leak issue. This patch avoid this.
Signed-off-by: Li Qiang <liq3ea@gmail.com>
---
hw/display/virtio-gpu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index cc725a6..98dadf2 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -360,6 +360,7 @@ static void virtio_gpu_resource_destroy(VirtIOGPU *g,
struct virtio_gpu_simple_resource *res)
{
pixman_image_unref(res->image);
+ virtio_gpu_cleanup_mapping(res);
QTAILQ_REMOVE(&g->reslist, res, next);
g_free(res);
}
--
1.8.3.1
next prev parent reply other threads:[~2016-11-24 12:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-24 12:30 [Qemu-devel] [PATCH 0/2] fix memory leak in virtio_gpu_resource_destroy Li Qiang
2016-11-24 12:30 ` [Qemu-devel] [PATCH 1/2] virtio-gpu: add declaration for virtio_gpu_cleanup_mapping function Li Qiang
2016-11-24 12:30 ` Li Qiang [this message]
2016-11-28 12:44 ` [Qemu-devel] [PATCH 2/2] virtio-gpu: call cleanup mapping function in resource destroy Marc-André Lureau
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=1479990609-28243-3-git-send-email-liq3ea@gmail.com \
--to=liq3ea@gmail.com \
--cc=kraxel@redhat.com \
--cc=liqiang6-s@360.cn \
--cc=marcandre.lureau@gmail.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).