tu/drm/virtio: Add missing lock to virtio_bo_init_dmabuf

Lock vma mutex when freeing iova in virtio_bo_init_dmabuf.

Fixes: f17c5297d7 ("tu: Add virtgpu support")
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40507>
This commit is contained in:
Valentine Burley 2026-03-19 11:08:08 +01:00 committed by Marge Bot
parent 9f224289b0
commit 28e3fb7052

View file

@ -849,7 +849,9 @@ virtio_bo_init_dmabuf(struct tu_device *dev,
result =
tu_bo_init(dev, NULL, bo, handle, size, iova, flags, "dmabuf");
if (result != VK_SUCCESS) {
mtx_lock(&dev->vma_mutex);
util_vma_heap_free(&dev->vma, iova, size);
mtx_unlock(&dev->vma_mutex);
memset(bo, 0, sizeof(*bo));
} else {
*out_bo = bo;