wsi/display: check alloc failure in wsi_display_alloc_connector()
authorYogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Sat, 4 Mar 2023 05:09:15 +0000 (10:39 +0530)
committerMarge Bot <emma+marge@anholt.net>
Sat, 4 Mar 2023 21:20:54 +0000 (21:20 +0000)
commitaf953616a10ad8b122b1d3906b855c0a5f9fbfa7
tree3c930748f0076d363f81bec90c5baea788996f8a
parent82cc236458cdca2995dfc125096d8a0a8d8b14c6
wsi/display: check alloc failure in wsi_display_alloc_connector()

vulkancts test dEQP-VK.wsi.direct_drm.surface.create_simulate_oom is failing
because in wsi_display_alloc_connector() function memory allocation for
connector is not checked for return NULL. create_simulate_oom test simulates
out of memory, hence memory allocation fails for connector and later when
tried to dereference connector program will segfault.

This patch fixes the dEQP-VK.wsi.direct_drm.surface.create_simulate_oom test
segfault issue by checking if connector is NULL afer memory allocation.

Cc: mesa-stable
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21701>
src/vulkan/wsi/wsi_common_display.c