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 <>
Part-of: <>
(cherry picked from commit af953616a10ad8b122b1d3906b855c0a5f9fbfa7)
diff --git a/.pick_status.json b/.pick_status.json
index d706153..e4dc71f 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -2173,7 +2173,7 @@
         "description": "wsi/display: check alloc failure in wsi_display_alloc_connector()",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
diff --git a/src/vulkan/wsi/wsi_common_display.c b/src/vulkan/wsi/wsi_common_display.c
index 0e5d272..4d92cd1 100644
--- a/src/vulkan/wsi/wsi_common_display.c
+++ b/src/vulkan/wsi/wsi_common_display.c
@@ -294,6 +294,8 @@
    struct wsi_display_connector *connector =
       vk_zalloc(wsi->alloc, sizeof (struct wsi_display_connector),
+   if (!connector)
+      return NULL;
    connector->id = connector_id;
    connector->wsi = wsi;