Skip to content

Commit

Permalink
UPSTREAM: drm/virtio: Unlock reservations on dma_resv_reserve_fences(…
Browse files Browse the repository at this point in the history
…) 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: c8d4c18 ("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>
(cherry picked from commit 0f87739)

BUG=b:242065767
TEST=build test

Signed-off-by: Linux Patches Robot <linux-patches-robot@chromeos-missing-patches.google.com.iam.gserviceaccount.com>
Change-Id: I3d8d79ec78cb6db5b86c42fb469fa9761dc112cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/3973239
Reviewed-by: Sean Paul <sean@poorly.run>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Guenter Roeck <groeck@chromium.org>
Commit-Queue: Guenter Roeck <groeck@chromium.org>
  • Loading branch information
Linux Patches Robot authored and Chromeos LUCI committed Nov 2, 2022
1 parent 3bc6044 commit 6e387a1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/virtio/virtgpu_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6e387a1

Please sign in to comment.