vk/wsi: avoid reading uninitialised memory
authorEric Engestrom <eric.engestrom@intel.com>
Tue, 17 Jul 2018 12:13:40 +0000 (13:13 +0100)
committerEric Engestrom <eric.engestrom@intel.com>
Thu, 23 Aug 2018 13:47:59 +0000 (14:47 +0100)
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@intel.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/vulkan/wsi/wsi_common_x11.c

index aaa4d1e658e89b14a007dec002a3aaa00812337d..d4c1790575f9f1780e40a7454642ca9ad8512d58 100644 (file)
@@ -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;