diff options
author | Dmitry Osipenko <dmitry.osipenko@collabora.com> | 2022-06-30 23:07:18 +0300 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2022-07-19 15:40:57 +0300 |
commit | 64b88afbd92fbf434759d1896a7cf705e1c00e79 (patch) | |
tree | 56fbf2fb5d3efdfe0daaefb824fd7da9a6ca8ea8 /drivers/gpu/drm/virtio | |
parent | 15fced5b051e6e22c228a521a5894b12c2ba0892 (diff) | |
download | linux-64b88afbd92fbf434759d1896a7cf705e1c00e79.tar.xz |
drm/virtio: Correct drm_gem_shmem_get_sg_table() error handling
Previous commit fixed checking of the ERR_PTR value returned by
drm_gem_shmem_get_sg_table(), but it missed to zero out the shmem->pages,
which will crash virtio_gpu_cleanup_object(). Add the missing zeroing of
the shmem->pages.
Fixes: c24968734abf ("drm/virtio: Fix NULL vs IS_ERR checking in virtio_gpu_object_shmem_init")
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20220630200726.1884320-2-dmitry.osipenko@collabora.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/virtio')
-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 1cc8f3fc8e4b..87b19b3b96e0 100644 --- a/drivers/gpu/drm/virtio/virtgpu_object.c +++ b/drivers/gpu/drm/virtio/virtgpu_object.c @@ -170,6 +170,7 @@ static int virtio_gpu_object_shmem_init(struct virtio_gpu_device *vgdev, shmem->pages = drm_gem_shmem_get_sg_table(&bo->base); if (IS_ERR(shmem->pages)) { drm_gem_shmem_unpin(&bo->base); + shmem->pages = NULL; return PTR_ERR(shmem->pages); } |