mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 13:00:09 +01:00
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>
This commit is contained in:
parent
82cc236458
commit
af953616a1
1 changed files with 2 additions and 0 deletions
|
|
@ -302,6 +302,8 @@ wsi_display_alloc_connector(struct wsi_display *wsi,
|
|||
struct wsi_display_connector *connector =
|
||||
vk_zalloc(wsi->alloc, sizeof (struct wsi_display_connector),
|
||||
8, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
|
||||
if (!connector)
|
||||
return NULL;
|
||||
|
||||
connector->id = connector_id;
|
||||
connector->wsi = wsi;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue