Mesa (master): vulkan/wsi: clean up cleanup path
Eric Engeström
eric_engestrom at kemper.freedesktop.org
Fri Mar 9 13:38:46 UTC 2018
Module: Mesa
Branch: master
Commit: e903a7b0bbcadc8911e1b32addd6186acd548809
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e903a7b0bbcadc8911e1b32addd6186acd548809
Author: Eric Engestrom <eric.engestrom at imgtec.com>
Date: Mon Feb 26 13:34:54 2018 +0000
vulkan/wsi: clean up cleanup path
Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
Reviewed-by: Keith Packard <keithp at keithp.com>
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
---
src/vulkan/wsi/wsi_common.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c
index edba13a13d..fe262b4968 100644
--- a/src/vulkan/wsi/wsi_common.c
+++ b/src/vulkan/wsi/wsi_common.c
@@ -82,20 +82,20 @@ wsi_device_init(struct wsi_device *wsi,
#ifdef VK_USE_PLATFORM_XCB_KHR
result = wsi_x11_init_wsi(wsi, alloc);
if (result != VK_SUCCESS)
- return result;
+ goto fail;
#endif
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
result = wsi_wl_init_wsi(wsi, alloc, pdevice);
- if (result != VK_SUCCESS) {
-#ifdef VK_USE_PLATFORM_XCB_KHR
- wsi_x11_finish_wsi(wsi, alloc);
-#endif
- return result;
- }
+ if (result != VK_SUCCESS)
+ goto fail;
#endif
return VK_SUCCESS;
+
+fail:
+ wsi_device_finish(wsi, alloc);
+ return result;
}
void
More information about the mesa-commit
mailing list