vulkan/wsi/x11: Better handle wsi_x11_connection_create failure
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 2 Nov 2016 00:16:14 +0000 (17:16 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 2 Nov 2016 16:25:57 +0000 (09:25 -0700)
Without this fix, the function would still end up returning NULL but it
would put that NULL connection in the hash table which would be bad.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
src/vulkan/wsi/wsi_common_x11.c

index 8142847..eee2359 100644 (file)
@@ -118,6 +118,8 @@ wsi_x11_get_connection(struct wsi_device *wsi_dev,
 
       struct wsi_x11_connection *wsi_conn =
          wsi_x11_connection_create(alloc, conn);
+      if (!wsi_conn)
+         return NULL;
 
       pthread_mutex_lock(&wsi->mutex);