glx: Guard usage of infer_zink && !explicit_zink in glxext.c
authorYonggang Luo <luoyonggang@gmail.com>
Thu, 22 Sep 2022 09:43:08 +0000 (17:43 +0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 20 Oct 2022 17:06:10 +0000 (17:06 +0000)
Fixes: 2569215f43f ("egl/glx: add fallback for zink loading")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18749>

src/glx/glxext.c

index 5e955fc..927d065 100644 (file)
@@ -974,6 +974,7 @@ __glXInitialize(Display * dpy)
 #endif
 
    if (!AllocAndFetchScreenConfigs(dpy, dpyPriv)) {
+#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
       Bool fail = true;
       /* if zink was inferred, retry without zink */
       if (infer_zink && !explicit_zink) {
@@ -985,6 +986,10 @@ __glXInitialize(Display * dpy)
          free(dpyPriv);
          return NULL;
       }
+#else
+      free(dpyPriv);
+      return NULL;
+#endif
    }
 
    __glX_send_client_info(dpyPriv);