mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 02:48:06 +02:00
tu/drm/virtio: Move set_iova into success path of virtio_bo_init_dmabuf
set_iova() was called unconditionally after tu_bo_init(), even on the
failure path where the BO has been zeroed. This would call set_iova()
with res_id 0 and a stale iova, corrupting the iova mapping.
Move set_iova() into the success branch so it is only called when
tu_bo_init() succeeds.
Fixes: db88a490b8 ("tu: Avoid extraneous set_iova")
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
28e3fb7052
commit
7a96bc3187
1 changed files with 1 additions and 2 deletions
|
|
@ -855,10 +855,9 @@ virtio_bo_init_dmabuf(struct tu_device *dev,
|
|||
memset(bo, 0, sizeof(*bo));
|
||||
} else {
|
||||
*out_bo = bo;
|
||||
set_iova(dev, bo->res_id, iova);
|
||||
}
|
||||
|
||||
set_iova(dev, bo->res_id, iova);
|
||||
|
||||
out_unlock:
|
||||
u_rwlock_wrunlock(&dev->dma_bo_lock);
|
||||
return result;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue