Mesa (master): vk/wsi: avoid reading uninitialised memory

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 23 13:48:43 UTC 2018


Module: Mesa
Branch: master
Commit: 993a456360df6dc40f98bd199d3cbd259dd91a42
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=993a456360df6dc40f98bd199d3cbd259dd91a42

Author: Eric Engestrom <eric.engestrom at intel.com>
Date:   Tue Jul 17 13:13:40 2018 +0100

vk/wsi: avoid reading uninitialised memory

It will be ignored by x11_swapchain_result() anyway (because reaching
the `fail` label without setting `result` means the swapchain status was
already a hard error), but the compiler still complains about reading
uninitialised memory.

While at it, drop the unused assignment right before returning.

Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>

---

 src/vulkan/wsi/wsi_common_x11.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c
index aaa4d1e658..d4c1790575 100644
--- a/src/vulkan/wsi/wsi_common_x11.c
+++ b/src/vulkan/wsi/wsi_common_x11.c
@@ -980,7 +980,7 @@ static void *
 x11_manage_fifo_queues(void *state)
 {
    struct x11_swapchain *chain = state;
-   VkResult result;
+   VkResult result = VK_SUCCESS;
 
    assert(chain->base.present_mode == VK_PRESENT_MODE_FIFO_KHR);
 
@@ -1024,7 +1024,7 @@ x11_manage_fifo_queues(void *state)
    }
 
 fail:
-   result = x11_swapchain_result(chain, result);
+   x11_swapchain_result(chain, result);
    wsi_queue_push(&chain->acquire_queue, UINT32_MAX);
 
    return NULL;




More information about the mesa-commit mailing list