tu/drm: Add missing error path cleanup

Fixes: bea6290ca0 ("turnip: device global bo list")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23533>
(cherry picked from commit 84524cfdfa)
This commit is contained in:
Rob Clark 2023-06-21 14:46:46 -07:00 committed by Dylan Baker
parent d65ebabbb1
commit 82db601297
2 changed files with 3 additions and 1 deletions

View file

@ -10154,7 +10154,7 @@
"description": "tu/drm: Add missing error path cleanup",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "bea6290ca090a7be7e7d51c9316cf68337ac4e1f",
"notes": null

View file

@ -483,6 +483,8 @@ tu_bo_init(struct tu_device *dev,
vk_realloc(&dev->vk.alloc, dev->bo_list, new_len * sizeof(*dev->bo_list),
8, VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
if (!new_ptr) {
dev->bo_count--;
mtx_unlock(&dev->bo_mutex);
tu_gem_close(dev, gem_handle);
return VK_ERROR_OUT_OF_HOST_MEMORY;
}