drm/virtio: Correct drm_gem_shmem_get_sg_table() error handling
authorDmitry Osipenko <dmitry.osipenko@collabora.com>
Thu, 30 Jun 2022 20:07:18 +0000 (23:07 +0300)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 19 Jul 2022 12:40:57 +0000 (14:40 +0200)
commit64b88afbd92fbf434759d1896a7cf705e1c00e79
tree56fbf2fb5d3efdfe0daaefb824fd7da9a6ca8ea8
parent15fced5b051e6e22c228a521a5894b12c2ba0892
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>
drivers/gpu/drm/virtio/virtgpu_object.c