summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2019-10-22 15:34:12 +0300
committerDylan Baker <[email protected]>2019-10-25 09:06:25 -0700
commitf0cad4c038f91df1eb7fa4cbdfe0ebde16a9ef58 (patch)
treec53c561de6bb1fd2c521409155e7bc530c76aa79
parentc5f5ce1e3756331e79617d553720e47b2e8eb25b (diff)
anv: fix unwind of vkCreateDevice fail
We're skipping the context destruction in some cases which is the grand scheme of thing is not that important because closing device->fd will destroy the associated context as well. Signed-off-by: Lionel Landwerlin <[email protected]> Reported-by: Jordan Justen <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Cc: <[email protected]> Fixes: b30e01aef56 ("anv: fix memory leak on device destroy") (cherry picked from commit 0dfa643feb6e80f654fdc4efc71c22e751a53de3)
-rw-r--r--src/intel/vulkan/anv_device.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 510f0090ece..835a9bc7620 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -2392,7 +2392,7 @@ VkResult anv_CreateDevice(
if (physical_device->use_softpin) {
if (pthread_mutex_init(&device->vma_mutex, NULL) != 0) {
result = vk_error(VK_ERROR_INITIALIZATION_FAILED);
- goto fail_fd;
+ goto fail_context_id;
}
/* keep the page with address zero out of the allocator */
@@ -2585,13 +2585,13 @@ VkResult anv_CreateDevice(
pthread_cond_destroy(&device->queue_submit);
fail_mutex:
pthread_mutex_destroy(&device->mutex);
- fail_context_id:
- anv_gem_destroy_context(device, device->context_id);
fail_vmas:
if (physical_device->use_softpin) {
util_vma_heap_finish(&device->vma_hi);
util_vma_heap_finish(&device->vma_lo);
}
+ fail_context_id:
+ anv_gem_destroy_context(device, device->context_id);
fail_fd:
close(device->fd);
fail_device: