From a61f3079967e774b40d27e378c463fb52a89558e Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Wed, 20 May 2015 19:51:10 -0700 Subject: [PATCH] vk: Fix result of vkCreateInstance When fill_physical_device() fails, don't return VK_SUCCESS. --- src/vulkan/device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vulkan/device.c b/src/vulkan/device.c index f6578d01341..3c245cd036b 100644 --- a/src/vulkan/device.c +++ b/src/vulkan/device.c @@ -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; -- 2.30.2