Skip to content

tu: Free `device->bo_idx` and `device->bo_list` on init failure

Matt Turner requested to merge mattst88/mesa:tu-alloc-failure-fixes into main

Two related changes:

  • in tu_device.c:tu_CreateDevice we need to free both pointers in the teardown path after tu_bo_finish(global_bo), which uses the pointers. They are allocated in the first call to tu_bo_init(), which happens when global_bo is allocated.

  • in tu_drm.c:tu_bo_init we need to free bo_list if the bo_idx allocation fails. Convert to the goto teardown pattern as well.

Fixes the following dEQP-VK tests:

  • dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail
  • dEQP-VK.api.object_management.alloc_callback_fail.device
  • dEQP-VK.api.object_management.alloc_callback_fail.device_group

Merge request reports