From: Marek Olšák Date: Thu, 5 Jul 2018 22:15:31 +0000 (-0400) Subject: st/dri: fix a crash in server_wait_sync X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0eaf069679ccf86de6739d5eaa439db075f02903;p=mesa.git st/dri: fix a crash in server_wait_sync Ported from i965 including the comment. This fixes: dEQP-EGL.functional.reusable_sync.valid.wait_server Cc: 18.1 Reviewed-by: Michel Dänzer --- diff --git a/src/gallium/state_trackers/dri/dri_helpers.c b/src/gallium/state_trackers/dri/dri_helpers.c index f1501bfb815..5d42873a208 100644 --- a/src/gallium/state_trackers/dri/dri_helpers.c +++ b/src/gallium/state_trackers/dri/dri_helpers.c @@ -214,6 +214,12 @@ dri2_server_wait_sync(__DRIcontext *_ctx, void *_fence, unsigned flags) struct pipe_context *ctx = dri_context(_ctx)->st->pipe; struct dri2_fence *fence = (struct dri2_fence*)_fence; + /* We might be called here with a NULL fence as a result of WaitSyncKHR + * on a EGL_KHR_reusable_sync fence. Nothing to do here in such case. + */ + if (!fence) + return; + if (ctx->fence_server_sync) ctx->fence_server_sync(ctx, fence->pipe_fence); }