From fbdc5814ad98d37616dd7bf6d28ecc279007dd71 Mon Sep 17 00:00:00 2001 From: Zan Dobersek Date: Mon, 1 Jun 2026 09:53:13 +0200 Subject: [PATCH] tu/kgsl: initialize dump bo state in kgsl_bo_init sooner In kgsl_bo_init(), tu_dump_bo_init() should be called for tu_bo after it's initialized and before it's possibly mapped, since the mapping can fail and cause kgsl_bo_finish() to call tu_dump_bo_del() for tu_bo with an improperly initialized dump_bo_list_idx, leading to crashes. Signed-off-by: Zan Dobersek Part-of: --- src/freedreno/vulkan/tu_knl_kgsl.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/freedreno/vulkan/tu_knl_kgsl.cc b/src/freedreno/vulkan/tu_knl_kgsl.cc index 4c6d9eca27f..f733091d3ef 100644 --- a/src/freedreno/vulkan/tu_knl_kgsl.cc +++ b/src/freedreno/vulkan/tu_knl_kgsl.cc @@ -298,6 +298,8 @@ kgsl_bo_init(struct tu_device *dev, .base = base, }; + tu_dump_bo_init(dev, bo); + VkResult result = VK_SUCCESS; if (lazy_vma) { @@ -309,8 +311,6 @@ kgsl_bo_init(struct tu_device *dev, if (result != VK_SUCCESS) return result; - tu_dump_bo_init(dev, bo); - *out_bo = bo; TU_RMV(bo_allocate, dev, bo);