mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 07:08:04 +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> (cherry picked from commit7a96bc3187) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
This commit is contained in:
parent
28f24b21ee
commit
2aa33f41e6
2 changed files with 2 additions and 3 deletions
|
|
@ -3864,7 +3864,7 @@
|
|||
"description": "tu/drm/virtio: Move set_iova into success path of virtio_bo_init_dmabuf",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "db88a490b8d257b5409dc2161c28838a6bd53160",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -853,10 +853,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