vk: Fix result of vkCreateInstance
authorChad Versace <chad.versace@intel.com>
Thu, 21 May 2015 02:51:10 +0000 (19:51 -0700)
committerChad Versace <chad.versace@intel.com>
Thu, 21 May 2015 02:51:10 +0000 (19:51 -0700)
When fill_physical_device() fails, don't return VK_SUCCESS.

src/vulkan/device.c

index f6578d01341378ce2062763e2086da05a9872339..3c245cd036bc61caca47a1209986d943f63a7eb6 100644 (file)
@@ -142,9 +142,11 @@ VkResult anv_CreateInstance(
    instance->physicalDeviceCount = 0;
    result = fill_physical_device(&instance->physicalDevice,
                                  instance, "/dev/dri/renderD128");
-   if (result == VK_SUCCESS)
-      instance->physicalDeviceCount++;
 
+   if (result != VK_SUCCESS)
+      return result;
+
+   instance->physicalDeviceCount++;
    *pInstance = (VkInstance) instance;
 
    return VK_SUCCESS;