summaryrefslogtreecommitdiffstats
path: root/src/vulkan/wsi
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-11-01 17:16:14 -0700
committerJason Ekstrand <[email protected]>2016-11-02 09:25:57 -0700
commitfc0e9e3e40e4b044ce1b62c1b757941f4ed4c820 (patch)
tree98b9e84ec4000472a272a6ce30c548833ba3af59 /src/vulkan/wsi
parente3e5b1a4884666ec806d4eb0188826578580d666 (diff)
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 <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Cc: "13.0" <[email protected]>
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 814284799f6..eee2359d03a 100644
--- a/src/vulkan/wsi/wsi_common_x11.c
+++ b/src/vulkan/wsi/wsi_common_x11.c
@@ -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);