Mesa (master): anv: fixup unwinding of device create failure

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed May 20 17:03:24 UTC 2020


Module: Mesa
Branch: master
Commit: f36708b143fec1a09c46ea13324df08c0cb5f667
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f36708b143fec1a09c46ea13324df08c0cb5f667

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Wed Dec 25 22:08:51 2019 +0200

anv: fixup unwinding of device create failure

We appear to have the ordering mixed up a bit.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3203>

---

 src/intel/vulkan/anv_device.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index d9f15b46332..5b4c952a338 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -2984,7 +2984,7 @@ VkResult anv_CreateDevice(
       unreachable("unhandled gen");
    }
    if (result != VK_SUCCESS)
-      goto fail_workaround_bo;
+      goto fail_clear_value_bo;
 
    anv_pipeline_cache_init(&device->default_pipeline_cache, device, true);
 
@@ -2998,13 +2998,14 @@ VkResult anv_CreateDevice(
 
    return VK_SUCCESS;
 
- fail_workaround_bo:
-   anv_scratch_pool_finish(device, &device->scratch_pool);
+ fail_clear_value_bo:
    if (device->info.gen >= 10)
       anv_device_release_bo(device, device->hiz_clear_bo);
-   anv_device_release_bo(device, device->workaround_bo);
+   anv_scratch_pool_finish(device, &device->scratch_pool);
  fail_trivial_batch_bo:
    anv_device_release_bo(device, device->trivial_batch_bo);
+ fail_workaround_bo:
+   anv_device_release_bo(device, device->workaround_bo);
  fail_surface_aux_map_pool:
    if (device->info.gen >= 12) {
       gen_aux_map_finish(device->aux_map_ctx);



More information about the mesa-commit mailing list