mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
tu/drm/virtio: Fix GEM handle leak in tu_bo_init error path
In tu_bo_init, if growing the submit BO list fails, the GEM handle
must be closed. However, bo->gem_handle is only populated later
via compound assignment. Use the gem_handle parameter directly
to ensure the correct handle is closed and not leaked.
Fixes: d67d501af4 ("tu/drm/virtio: Switch to vdrm helper")
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
eb7897f57b
commit
316d9b0209
1 changed files with 1 additions and 1 deletions
|
|
@ -593,7 +593,7 @@ tu_bo_init(struct tu_device *dev,
|
|||
if (!new_ptr) {
|
||||
dev->submit_bo_count--;
|
||||
mtx_unlock(&dev->bo_mutex);
|
||||
vdrm_bo_close(dev->vdev->vdrm, bo->gem_handle);
|
||||
vdrm_bo_close(dev->vdev->vdrm, gem_handle);
|
||||
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue