mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 20:18:12 +02:00
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> (cherry picked from commit28e3fb7052) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
This commit is contained in:
parent
0b54363202
commit
28f24b21ee
2 changed files with 3 additions and 1 deletions
|
|
@ -3874,7 +3874,7 @@
|
|||
"description": "tu/drm/virtio: Add missing lock to virtio_bo_init_dmabuf",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "f17c5297d7a01eb37815f96bbf3a87667a2f3261",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -847,7 +847,9 @@ virtio_bo_init_dmabuf(struct tu_device *dev,
|
|||
result =
|
||||
tu_bo_init(dev, NULL, bo, handle, size, iova, TU_BO_ALLOC_NO_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
Reference in a new issue