Mesa (main): vulkan/wsi/wayland: fix wsi_wl_image_init error code

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 8 10:25:05 UTC 2021


Module: Mesa
Branch: main
Commit: 7d711a10aa5ce5a045901381e80d9b41f2be08b2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7d711a10aa5ce5a045901381e80d9b41f2be08b2

Author: Simon Ser <contact at emersion.fr>
Date:   Thu Jun 24 20:30:25 2021 +0200

vulkan/wsi/wayland: fix wsi_wl_image_init error code

If image->buffer cannot be allocated, the value returned by
wsi_create_native_image is returned. However, if we got that far,
that value is VK_SUCCESS.

Fix it and return VK_ERROR_OUT_OF_HOST_MEMORY.

Signed-off-by: Simon Ser <contact at emersion.fr>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11589>

---

 src/vulkan/wsi/wsi_common_wayland.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
index d5069ac7e5d..219c77692c4 100644
--- a/src/vulkan/wsi/wsi_common_wayland.c
+++ b/src/vulkan/wsi/wsi_common_wayland.c
@@ -1000,7 +1000,7 @@ wsi_wl_image_init(struct wsi_wl_swapchain *chain,
 fail_image:
    wsi_destroy_image(&chain->base, &image->base);
 
-   return result;
+   return VK_ERROR_OUT_OF_HOST_MEMORY;
 }
 
 static VkResult



More information about the mesa-commit mailing list