Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 993849ce authored by Jesse Hall's avatar Jesse Hall
Browse files

libvulkan: Really only write vkCreateInstance out parameter on success

Change-Id: I7efc7dba420565781f15610bbfa7dfd1be1cf84d
(cherry picked from commit 92707024c23b737cad16366ee7380a00e88a797e)
parent ae3b70de
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1130,7 +1130,9 @@ VkResult CreateInstance_Top(const VkInstanceCreateInfo* create_info,
    result = create_instance(create_info, allocator, &handle);
    if (enable_callback)
        FreeAllocatedCreateInfo(local_create_info, instance->alloc);
    if (result < 0) {
    if (result >= 0) {
        *instance_out = instance->handle;
    } else {
        // For every layer, including the loader top and bottom layers:
        // - If a call to the next CreateInstance fails, the layer must clean
        //   up anything it has successfully done so far, and propagate the
@@ -1160,7 +1162,6 @@ VkResult CreateInstance_Top(const VkInstanceCreateInfo* create_info,
                                     allocator, &instance->message);
    }

    *instance_out = instance->handle;
    return result;
}