All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] virtio-gpu: fix memory leak in update_cursor_data_virgl
@ 2016-11-01 11:06 Li Qiang
  2016-11-01 11:16 ` Gerd Hoffmann
  2016-11-01 11:17 ` Marc-André Lureau
  0 siblings, 2 replies; 3+ messages in thread
From: Li Qiang @ 2016-11-01 11:06 UTC (permalink / raw)
  To: kraxel, qemu-devel; +Cc: Li Qiang

From: Li Qiang <liqiang6-s@360.cn>

In update_cursor_data_virgl function, if the 'width'/ 'height'
is not equal to current cursor's width/height it will return
without free the 'data' allocated previously. This will lead
a memory leak issue. This patch fix 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 60bce94..5f32e1a 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -84,6 +84,7 @@ static void update_cursor_data_virgl(VirtIOGPU *g,
 
     if (width != s->current_cursor->width ||
         height != s->current_cursor->height) {
+        free(data);
         return;
     }
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio-gpu: fix memory leak in update_cursor_data_virgl
  2016-11-01 11:06 [Qemu-devel] [PATCH] virtio-gpu: fix memory leak in update_cursor_data_virgl Li Qiang
@ 2016-11-01 11:16 ` Gerd Hoffmann
  2016-11-01 11:17 ` Marc-André Lureau
  1 sibling, 0 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2016-11-01 11:16 UTC (permalink / raw)
  To: Li Qiang; +Cc: qemu-devel, Li Qiang

On Di, 2016-11-01 at 04:06 -0700, Li Qiang wrote:
> From: Li Qiang <liqiang6-s@360.cn>
> 
> In update_cursor_data_virgl function, if the 'width'/ 'height'
> is not equal to current cursor's width/height it will return
> without free the 'data' allocated previously. This will lead
> a memory leak issue. This patch fix 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 60bce94..5f32e1a 100644
> --- a/hw/display/virtio-gpu.c
> +++ b/hw/display/virtio-gpu.c
> @@ -84,6 +84,7 @@ static void update_cursor_data_virgl(VirtIOGPU *g,
>  
>      if (width != s->current_cursor->width ||
>          height != s->current_cursor->height) {
> +        free(data);
>          return;
>      }
>  

Added to vga patch queue.

thanks,
  Gerd

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio-gpu: fix memory leak in update_cursor_data_virgl
  2016-11-01 11:06 [Qemu-devel] [PATCH] virtio-gpu: fix memory leak in update_cursor_data_virgl Li Qiang
  2016-11-01 11:16 ` Gerd Hoffmann
@ 2016-11-01 11:17 ` Marc-André Lureau
  1 sibling, 0 replies; 3+ messages in thread
From: Marc-André Lureau @ 2016-11-01 11:17 UTC (permalink / raw)
  To: Li Qiang, kraxel, qemu-devel; +Cc: Li Qiang

Hi

On Tue, Nov 1, 2016 at 2:07 PM Li Qiang <liq3ea@gmail.com> wrote:

> From: Li Qiang <liqiang6-s@360.cn>
>
> In update_cursor_data_virgl function, if the 'width'/ 'height'
> is not equal to current cursor's width/height it will return
> without free the 'data' allocated previously. This will lead
> a memory leak issue. This patch fix 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 60bce94..5f32e1a 100644
> --- a/hw/display/virtio-gpu.c
> +++ b/hw/display/virtio-gpu.c
> @@ -84,6 +84,7 @@ static void update_cursor_data_virgl(VirtIOGPU *g,
>
>      if (width != s->current_cursor->width ||
>          height != s->current_cursor->height) {
> +        free(data);
>          return;
>      }
>
> --
> 1.8.3.1
>
>
> --
Marc-André Lureau

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-01 11:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-01 11:06 [Qemu-devel] [PATCH] virtio-gpu: fix memory leak in update_cursor_data_virgl Li Qiang
2016-11-01 11:16 ` Gerd Hoffmann
2016-11-01 11:17 ` Marc-André Lureau

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.