Mesa (master): vulkan/wsi/x11: Better handle wsi_x11_connection_create failure

Jason Ekstrand jekstrand at kemper.freedesktop.org
Wed Nov 2 16:27:26 UTC 2016


Module: Mesa
Branch: master
Commit: fc0e9e3e40e4b044ce1b62c1b757941f4ed4c820
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fc0e9e3e40e4b044ce1b62c1b757941f4ed4c820

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Tue Nov  1 17:16:14 2016 -0700

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 at jlekstrand.net>
Reviewed-by: Dave Airlie <airlied at redhat.com>
Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>
Cc: "13.0" <mesa-stable at lists.freedesktop.org>

---

 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 8142847..eee2359 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);
 




More information about the mesa-commit mailing list