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:
parent
9f224289b0
commit
28e3fb7052
1 changed files with 2 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue