loader: Fix regression with dEQP-VK.api.object_management.alloc_callback_fail.device
authorPiers Daniell <pdaniell@nvidia.com>
Tue, 5 Apr 2016 23:28:06 +0000 (17:28 -0600)
committerJon Ashburn <jon@lunarg.com>
Wed, 6 Apr 2016 15:59:25 +0000 (09:59 -0600)
When the loader vkCreateDevice trampoline code calls down to
vkCreateDevice don't update the dev->device field with a bogus device
handle.

Change-Id: I703acb5283650ab0013483bda0f478da9b46e3ea

loader/loader.c

index e5b9efe..5850676 100644 (file)
@@ -3559,6 +3559,9 @@ VkResult loader_create_device_chain(const struct loader_physical_device_tramp *p
         loader_create_info.pNext = &create_info_disp;
         res = fpCreateDevice(pd->phys_dev, &loader_create_info, pAllocator,
                              &created_device);
+        if (res != VK_SUCCESS) {
+            return res;
+        }
         dev->device = created_device;
     } else {
         // Couldn't find CreateDevice function!