From fc0e9e3e40e4b044ce1b62c1b757941f4ed4c820 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Tue, 1 Nov 2016 17:16:14 -0700 Subject: [PATCH] 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 Reviewed-by: Dave Airlie Reviewed-by: Eric Engestrom Cc: "13.0" --- src/vulkan/wsi/wsi_common_x11.c | 2 ++ 1 file changed, 2 insertions(+) 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); -- 2.30.2