From facc63b862069eb24c14837a6762e5e681e52b7a Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Sun, 21 Oct 2018 08:57:42 +0200 Subject: vo_gpu: vulkan: suppress bogus error message on --vulkan-device Since the code just broke out of the loop on a match rather than jumping straight to the end of the function body, it ended up hitting the code path for when the end of the list was reached. --- video/out/vulkan/context.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/video/out/vulkan/context.c b/video/out/vulkan/context.c index cbe0911385..6a029e10f8 100644 --- a/video/out/vulkan/context.c +++ b/video/out/vulkan/context.c @@ -54,16 +54,16 @@ static int vk_validate_dev(struct mp_log *log, const struct m_option *opt, res = vkCreateInstance(&info, MPVK_ALLOCATOR, &inst); if (res != VK_SUCCESS) - goto error; + goto done; res = vkEnumeratePhysicalDevices(inst, &num, NULL); if (res != VK_SUCCESS) - goto error; + goto done; devices = talloc_array(NULL, VkPhysicalDevice, num); vkEnumeratePhysicalDevices(inst, &num, devices); if (res != VK_SUCCESS) - goto error; + goto done; bool help = bstr_equals0(param, "help"); if (help) { @@ -80,14 +80,14 @@ static int vk_validate_dev(struct mp_log *log, const struct m_option *opt, (unsigned)prop.vendorID, (unsigned)prop.deviceID); } else if (bstr_equals0(param, prop.deviceName)) { ret = 0; - break; + goto done; } } if (!help) mp_err(log, "No device with name '%.*s'!\n", BSTR_P(param)); -error: +done: talloc_free(devices); return ret; } -- cgit v1.2.3