mesa/src/vulkan/device-select-layer
Erik Kurzinger f4eb13dc55 vulkan/device_select: avoid segfault on Wayland if wl_drm is unavailable
On Wayland, if the wl_drm interface is not available, for example if the
compositor is using the proprietary NVIDIA driver along with their egl-wayland
library, the device_select layer will fail to initialize. However, the failure
path will unconditionally call wl_drm_destroy even though info.wl_drm would be
NULL in that case. This can cause a segfault in libwayland-client.so.

To fix this, check if info.wl_drm is NULL before calling wl_drm_destroy. This
way, initialization will fail gracefully even if that interface is not present.

Signed-off-by: Erik Kurzinger <ekurzinger@nvidia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10598>
2021-05-04 21:26:21 +00:00
..
device_select.h vulkan/device_select: Store Vulkan vendorID and deviceID as uint32_t 2020-12-08 16:19:25 +00:00
device_select_layer.c vulkan/device_select: Only call vkGetPhysicalDeviceProperties2 if the device supports it. 2021-03-09 15:00:57 +00:00
device_select_wayland.c vulkan/device_select: avoid segfault on Wayland if wl_drm is unavailable 2021-05-04 21:26:21 +00:00
device_select_x11.c
meson.build vulkan: add missing src_inc to the device select layer 2020-12-02 07:44:10 +01:00
VkLayer_MESA_device_select.json device-select-layer: update for vulkan 1.2 2021-01-15 20:37:05 +00:00