summaryrefslogtreecommitdiffstats
path: root/src/vulkan/wsi
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-11-01 17:16:14 -0700
committerEmil Velikov <emil.l.velikov@gmail.com>2016-11-09 13:14:48 +0000
commitf622d3334733e0a1349e0283b6d03ded7f864e1e (patch)
tree88e5d56c10d3c5dc6ad4f3c52682b335b394cf0d /src/vulkan/wsi
parentdd5e802d338250ed9c9f2382cf67ed09a5a0f139 (diff)
downloadexternal_mesa3d-f622d3334733e0a1349e0283b6d03ded7f864e1e.zip
external_mesa3d-f622d3334733e0a1349e0283b6d03ded7f864e1e.tar.gz
external_mesa3d-f622d3334733e0a1349e0283b6d03ded7f864e1e.tar.bz2
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> (cherry picked from commit fc0e9e3e40e4b044ce1b62c1b757941f4ed4c820)
Diffstat (limited to 'src/vulkan/wsi')
-rw-r--r--src/vulkan/wsi/wsi_common_x11.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c
index 0128e1c..32a1be4 100644
--- a/src/vulkan/wsi/wsi_common_x11.c
+++ b/src/vulkan/wsi/wsi_common_x11.c
@@ -117,6 +117,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);