]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/virtio: Unlock reservations on dma_resv_reserve_fences() error
authorDmitry Osipenko <dmitry.osipenko@collabora.com>
Thu, 30 Jun 2022 20:07:21 +0000 (23:07 +0300)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 19 Jul 2022 12:40:58 +0000 (14:40 +0200)
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: f0e727ca74c9 ("dma-buf/drivers: make reserving a shared slot mandatory v4")
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20220630200726.1884320-5-dmitry.osipenko@collabora.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
drivers/gpu/drm/virtio/virtgpu_gem.c

index 580a788098361faeb0ac17cbfdbfbc35a22cb7a0..7db48d17ee3a8a9c638a8c6f9e58f35bd004b453 100644 (file)
@@ -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;
 }