From bc5892b7fc65d03a05a16693c16dbdd467f4c4bd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alejandro=20Pi=C3=B1eiro?= Date: Wed, 6 Oct 2021 11:28:15 +0200 Subject: [PATCH] v3dv: use NULL for vk_error on initialization failures This commit fixes two issues: * On CreateInstance, we are freeing the instance, and then trying to use it when calling vk_error. This could be problematic, so let's just use NULL. * On CreateDevice, we are getting a unsupported feature error, and then trying to call vk_error using the instance. That's is not really a instance error, and will assert when the ongoing common vk_error lands mesa. Let's use NULL instead, as the object it applies, the device, was not created. Reviewed-by: Iago Toral Quiroga Part-of: --- src/broadcom/vulkan/v3dv_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/broadcom/vulkan/v3dv_device.c b/src/broadcom/vulkan/v3dv_device.c index ad06b97..f4e3fa4 100644 --- a/src/broadcom/vulkan/v3dv_device.c +++ b/src/broadcom/vulkan/v3dv_device.c @@ -194,7 +194,7 @@ v3dv_CreateInstance(const VkInstanceCreateInfo *pCreateInfo, if (result != VK_SUCCESS) { vk_free(pAllocator, instance); - return vk_error(instance, result); + return vk_error(NULL, result); } v3d_process_debug_variable(); @@ -1754,7 +1754,7 @@ v3dv_CreateDevice(VkPhysicalDevice physicalDevice, &dispatch_table, pCreateInfo, pAllocator); if (result != VK_SUCCESS) { vk_free(&device->vk.alloc, device); - return vk_error(instance, result); + return vk_error(NULL, result); } device->instance = instance; -- 2.7.4