aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2020-07-12 13:40:14 +0200
committerSamuel Pitoiset <[email protected]>2020-07-15 13:53:37 +0200
commit0859dcb57c18905b2f30e78e1458fea36d111e20 (patch)
tree469c45c141f02300514e707a085fd06ce52bd263 /src
parent50fdefc025a57b25c5bf55d9876e8032b358c3b2 (diff)
radv: destroy the base object if VkCreateInstance() failed
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5868>
Diffstat (limited to 'src')
-rw-r--r--src/amd/vulkan/radv_device.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 8f2ea1b0def..e1e3c0b8a85 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -662,6 +662,7 @@ VkResult radv_CreateInstance(
if (idx >= RADV_INSTANCE_EXTENSION_COUNT ||
!radv_instance_extensions_supported.extensions[idx]) {
+ vk_object_base_finish(&instance->base);
vk_free2(&default_alloc, pAllocator, instance);
return vk_error(instance, VK_ERROR_EXTENSION_NOT_PRESENT);
}
@@ -718,6 +719,7 @@ VkResult radv_CreateInstance(
result = vk_debug_report_instance_init(&instance->debug_report_callbacks);
if (result != VK_SUCCESS) {
+ vk_object_base_finish(&instance->base);
vk_free2(&default_alloc, pAllocator, instance);
return vk_error(instance, result);
}