Browse Source

anv: Fix use of uninitialized variable.

The return variable was not set for failure paths.
It has now been changed to VK_ERROR_INITIALIZATION_FAILED
for failure paths.

Coverity: 1358944
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
[Emil Velikov: rebase against master, s/vulkan/anv/]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
tags/12.0-branchpoint
Robert Foss 10 years ago
parent
commit
5068d307f9
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      src/intel/vulkan/anv_wsi_wayland.c

+ 6
- 2
src/intel/vulkan/anv_wsi_wayland.c View File

@@ -782,12 +782,16 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface,

chain->display = wsi_wl_get_display(&device->instance->physicalDevice,
surface->display);
if (!chain->display)
if (!chain->display) {
result = vk_error(VK_ERROR_INITIALIZATION_FAILED);
goto fail;
}

chain->queue = wl_display_create_queue(chain->display->display);
if (!chain->queue)
if (!chain->queue) {
result = vk_error(VK_ERROR_INITIALIZATION_FAILED);
goto fail;
}

for (uint32_t i = 0; i < chain->image_count; i++) {
result = wsi_wl_image_init(chain, &chain->images[i], pAllocator);

Loading…
Cancel
Save