Commit b4a82e7f authored by Daniel Stone's avatar Daniel Stone Committed by Emil Velikov

vulkan: Fix Wayland uninitialised registry

Untangle the exit cleanup paths so we don't try to use the registry
variable before it's been initialised.
Signed-off-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
Reviewed-by: Lionel Landwerlin's avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit d9a8bba7)
parent 6dd570fa
......@@ -272,7 +272,7 @@ wsi_wl_display_create(struct wsi_wayland *wsi, struct wl_display *wl_display)
struct wl_registry *registry = wl_display_get_registry(wl_display);
if (!registry)
return NULL;
goto fail;
wl_registry_add_listener(registry, &registry_listener, display);
......@@ -280,24 +280,25 @@ wsi_wl_display_create(struct wsi_wayland *wsi, struct wl_display *wl_display)
wl_display_roundtrip(wl_display);
if (!display->drm)
goto fail;
goto fail_registry;
/* Round-rip to get wl_drm formats and capabilities */
wl_display_roundtrip(wl_display);
/* We need prime support */
if (!(display->capabilities & WL_DRM_CAPABILITY_PRIME))
goto fail;
goto fail_registry;
/* We don't need this anymore */
wl_registry_destroy(registry);
return display;
fail:
fail_registry:
if (registry)
wl_registry_destroy(registry);
fail:
wsi_wl_display_destroy(wsi, display);
return NULL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment