diff options
author | Xin He <hexin.op@bytedance.com> | 2020-07-22 13:18:51 +0800 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-08-07 13:59:08 +0200 |
commit | 836b194d65782aaec4485a07d2aab52d3f698505 (patch) | |
tree | 5c1020945ea22dd8b2542fff7a72687e2472a62d /drivers/gpu/drm | |
parent | 8b6ec999b198b59ae61e86e70f5e9df73fe4754f (diff) | |
download | linux-stable-836b194d65782aaec4485a07d2aab52d3f698505.tar.gz linux-stable-836b194d65782aaec4485a07d2aab52d3f698505.tar.bz2 linux-stable-836b194d65782aaec4485a07d2aab52d3f698505.zip |
drm/virtio: fix memory leak in virtio_gpu_cleanup_object()
Before setting shmem->pages to NULL, kfree() should
be called.
Signed-off-by: Xin He <hexin.op@bytedance.com>
Reviewed-by: Qi Liu <liuqi.16@bytedance.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200722051851.72662-1-hexin.op@bytedance.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/virtio/virtgpu_object.c | 1 |
1 files changed, 1 insertions, 0 deletions
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); } |