vulkan/wsi/x11: Better handle wsi_x11_connection_create failure

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>
This commit is contained in:
Jason Ekstrand 2016-11-01 17:16:14 -07:00
parent e3e5b1a488
commit fc0e9e3e40

View 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);