Re: [PATCH] drm/virtio: fix memory leak in virtio_gpu_cleanup_object()

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

 



Xin He <hexin.op@xxxxxxxxxxxxx> 于2020年7月22日周三 下午1:19写道:
>
> Before setting shmem->pages to NULL, kfree() should
> be called.
>
> Signed-off-by: Xin He <hexin.op@xxxxxxxxxxxxx>
> Reviewed-by: Qi Liu <liuqi.16@xxxxxxxxxxxxx>
> ---
>  drivers/gpu/drm/virtio/virtgpu_object.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio/virtgpu_object.c
> index 6ccbd01cd888..703b5cd51751 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_object.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_object.c
> @@ -79,6 +79,7 @@ void virtio_gpu_cleanup_object(struct virtio_gpu_object *bo)
>                         }
>
>                         sg_free_table(shmem->pages);
> +                       kfree(shmem->pages);
>                         shmem->pages = NULL;
>                         drm_gem_shmem_unpin(&bo->base.base);
>                 }
> --
> 2.21.1 (Apple Git-122.3)
>

Ping guys. Any comments or suggestions?

--
Xin He
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux