Commit 0f877398 authored by Dmitry Osipenko's avatar Dmitry Osipenko Committed by Gerd Hoffmann

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: c8d4c18b ("dma-buf/drivers: make reserving a shared slot mandatory v4")
Reviewed-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
Signed-off-by: default avatarDmitry Osipenko <dmitry.osipenko@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20220630200726.1884320-5-dmitry.osipenko@collabora.comSigned-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent fdf0ff4d
...@@ -228,8 +228,10 @@ int virtio_gpu_array_lock_resv(struct virtio_gpu_object_array *objs) ...@@ -228,8 +228,10 @@ int virtio_gpu_array_lock_resv(struct virtio_gpu_object_array *objs)
for (i = 0; i < objs->nents; ++i) { for (i = 0; i < objs->nents; ++i) {
ret = dma_resv_reserve_fences(objs->objs[i]->resv, 1); ret = dma_resv_reserve_fences(objs->objs[i]->resv, 1);
if (ret) if (ret) {
virtio_gpu_array_unlock_resv(objs);
return ret; return ret;
}
} }
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment