qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] virtio-gpu: fix memory leak in resource attach


From: Li Qiang
Subject: Re: [Qemu-devel] [PATCH] virtio-gpu: fix memory leak in resource attach backing
Date: Fri, 30 Dec 2016 14:13:22 +0800

2016-12-29 22:57 GMT+08:00 Marc-André Lureau <address@hidden>:

> Hi
>
> ----- Original Message -----
> > In the resource attach backing function, everytime it will
> > allocate 'res->iov' thus can leading a memory leak. This
> > patch avoid this.
> >
> > Signed-off-by: Li Qiang <address@hidden>
> > ---
> >  hw/display/virtio-gpu.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
> > index 5f32e1a..045f296 100644
> > --- a/hw/display/virtio-gpu.c
> > +++ b/hw/display/virtio-gpu.c
> > @@ -705,6 +705,11 @@ virtio_gpu_resource_attach_backing(VirtIOGPU *g,
> >          return;
> >      }
> >
> > +    if (res->iov) {
> > +        cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC;
> > +        return;
> > +    }
> > +
>
> I think I would rather return an error in the library for this case.
>
>
IIUC Do you mean virglrenderer library? There is no related to this library.

Thanks.


> >      ret = virtio_gpu_create_mapping_iov(&ab, cmd, &res->addrs,
> &res->iov);
> >      if (ret != 0) {
> >          cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC;
> > --
> > 1.8.3.1
> >
> >
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]