Mesa (main): v3dv: use NULL for vk_error on initialization failures

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Oct 6 10:03:30 UTC 2021


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

Author: Alejandro Piñeiro <apinheiro at igalia.com>
Date:   Wed Oct  6 11:28:15 2021 +0200

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 <itoral at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13219>

---

 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 ad06b97ec15..f4e3fa4eff0 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;



More information about the mesa-commit mailing list