From: Dmitry Osipenko Date: Thu, 30 Jun 2022 20:07:21 +0000 (+0300) Subject: drm/virtio: Unlock reservations on dma_resv_reserve_fences() error X-Git-Tag: v6.1-rc1~159^2~18^2~118 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0f877398d30e1df657a31a62f7c7de1869b072b5;p=thirdparty%2Fkernel%2Flinux.git drm/virtio: Unlock reservations on dma_resv_reserve_fences() error Unlock reservations on dma_resv_reserve_fences() error to fix recursive locking of the reservations when this error happens. Cc: stable@vger.kernel.org Fixes: c8d4c18bfbc4 ("dma-buf/drivers: make reserving a shared slot mandatory v4") Reviewed-by: Thomas Hellström Signed-off-by: Dmitry Osipenko Link: http://patchwork.freedesktop.org/patch/msgid/20220630200726.1884320-5-dmitry.osipenko@collabora.com Signed-off-by: Gerd Hoffmann --- diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c index 580a788098361..7db48d17ee3a8 100644 --- a/drivers/gpu/drm/virtio/virtgpu_gem.c +++ b/drivers/gpu/drm/virtio/virtgpu_gem.c @@ -228,8 +228,10 @@ int virtio_gpu_array_lock_resv(struct virtio_gpu_object_array *objs) for (i = 0; i < objs->nents; ++i) { ret = dma_resv_reserve_fences(objs->objs[i]->resv, 1); - if (ret) + if (ret) { + virtio_gpu_array_unlock_resv(objs); return ret; + } } return ret; }