* [Qemu-devel] [PATCH] virtio-gpu: fix memory leak in set scanout
@ 2017-01-22 7:42 Li Qiang
2017-01-23 9:09 ` Marc-André Lureau
2017-02-06 14:30 ` Gerd Hoffmann
0 siblings, 2 replies; 4+ messages in thread
From: Li Qiang @ 2017-01-22 7:42 UTC (permalink / raw)
To: kraxel, marcandre.lureau, qemu-devel; +Cc: Li Qiang
From: Li Qiang <liqiang6-s@360.cn>
In virtio_gpu_set_scanout function, when creating the 'rect'
its refcount is set to 2, by pixman_image_create_bits and
qemu_create_displaysurface_pixman function. This can lead
a memory leak issues. This patch avoid this issue.
Signed-off-by: Li Qiang <liqiang6-s@360.cn>
---
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 7a15c61..4aecea3 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -608,6 +608,7 @@ static void virtio_gpu_set_scanout(VirtIOGPU *g,
cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC;
return;
}
+ pixman_image_unref(rect);
dpy_gfx_replace_surface(g->scanout[ss.scanout_id].con, scanout->ds);
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] virtio-gpu: fix memory leak in set scanout
2017-01-22 7:42 [Qemu-devel] [PATCH] virtio-gpu: fix memory leak in set scanout Li Qiang
@ 2017-01-23 9:09 ` Marc-André Lureau
2017-02-06 3:16 ` Li Qiang
2017-02-06 14:30 ` Gerd Hoffmann
1 sibling, 1 reply; 4+ messages in thread
From: Marc-André Lureau @ 2017-01-23 9:09 UTC (permalink / raw)
To: Li Qiang, kraxel, qemu-devel; +Cc: Li Qiang
On Sun, Jan 22, 2017 at 11:43 AM Li Qiang <liq3ea@gmail.com> wrote:
> From: Li Qiang <liqiang6-s@360.cn>
>
> In virtio_gpu_set_scanout function, when creating the 'rect'
> its refcount is set to 2, by pixman_image_create_bits and
> qemu_create_displaysurface_pixman function. This can lead
> a memory leak issues. This patch avoid this issue.
>
> Signed-off-by: Li Qiang <liqiang6-s@360.cn>
>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.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 7a15c61..4aecea3 100644
> --- a/hw/display/virtio-gpu.c
> +++ b/hw/display/virtio-gpu.c
> @@ -608,6 +608,7 @@ static void virtio_gpu_set_scanout(VirtIOGPU *g,
> cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC;
> return;
> }
> + pixman_image_unref(rect);
> dpy_gfx_replace_surface(g->scanout[ss.scanout_id].con,
> scanout->ds);
> }
>
> --
> 1.8.3.1
>
>
> --
Marc-André Lureau
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] virtio-gpu: fix memory leak in set scanout
2017-01-23 9:09 ` Marc-André Lureau
@ 2017-02-06 3:16 ` Li Qiang
0 siblings, 0 replies; 4+ messages in thread
From: Li Qiang @ 2017-02-06 3:16 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel, Li Qiang, Marc-André Lureau
Hello Gerd,
Ping.
2017-01-23 17:09 GMT+08:00 Marc-André Lureau <marcandre.lureau@gmail.com>:
>
>
> On Sun, Jan 22, 2017 at 11:43 AM Li Qiang <liq3ea@gmail.com> wrote:
>
>> From: Li Qiang <liqiang6-s@360.cn>
>>
>> In virtio_gpu_set_scanout function, when creating the 'rect'
>> its refcount is set to 2, by pixman_image_create_bits and
>> qemu_create_displaysurface_pixman function. This can lead
>> a memory leak issues. This patch avoid this issue.
>>
>> Signed-off-by: Li Qiang <liqiang6-s@360.cn>
>>
>
>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.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 7a15c61..4aecea3 100644
>> --- a/hw/display/virtio-gpu.c
>> +++ b/hw/display/virtio-gpu.c
>> @@ -608,6 +608,7 @@ static void virtio_gpu_set_scanout(VirtIOGPU *g,
>> cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC;
>> return;
>> }
>> + pixman_image_unref(rect);
>> dpy_gfx_replace_surface(g->scanout[ss.scanout_id].con,
>> scanout->ds);
>> }
>>
>> --
>> 1.8.3.1
>>
>>
>> --
> Marc-André Lureau
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] virtio-gpu: fix memory leak in set scanout
2017-01-22 7:42 [Qemu-devel] [PATCH] virtio-gpu: fix memory leak in set scanout Li Qiang
2017-01-23 9:09 ` Marc-André Lureau
@ 2017-02-06 14:30 ` Gerd Hoffmann
1 sibling, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2017-02-06 14:30 UTC (permalink / raw)
To: Li Qiang; +Cc: marcandre.lureau, qemu-devel, Li Qiang
On Sa, 2017-01-21 at 23:42 -0800, Li Qiang wrote:
> From: Li Qiang <liqiang6-s@360.cn>
>
> In virtio_gpu_set_scanout function, when creating the 'rect'
> its refcount is set to 2, by pixman_image_create_bits and
> qemu_create_displaysurface_pixman function. This can lead
> a memory leak issues. This patch avoid this issue.
>
> Signed-off-by: Li Qiang <liqiang6-s@360.cn>
Added to vga patch queue.
thanks,
Gerd
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-02-06 14:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-22 7:42 [Qemu-devel] [PATCH] virtio-gpu: fix memory leak in set scanout Li Qiang
2017-01-23 9:09 ` Marc-André Lureau
2017-02-06 3:16 ` Li Qiang
2017-02-06 14:30 ` Gerd Hoffmann
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).