From: Jonathan Gray Date: Sun, 15 Jan 2023 02:48:10 +0000 (+1100) Subject: egl/dri2: avoid undefined unlocks X-Git-Tag: upstream/23.3.3~14205 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0594b3c143d48c5f37f705abb03f18fbbabbc6b0;p=platform%2Fupstream%2Fmesa.git egl/dri2: avoid undefined unlocks unlocks were incorrectly added to paths using dri2_egl_display() as well as those using dri2_egl_display_lock() pthread_mutex_unlock() when unlocked is documented by posix as being undefined behaviour. On OpenBSD pthread_mutex_unlock() will call abort(3) if this happens. Fixes: f1efe037dfd ("egl/dri2: Add display lock") Reviewed-by: Rob Clark Part-of: --- diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 6fbb001..f8a3863 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -2234,8 +2234,6 @@ dri2_get_sync_values_chromium(_EGLDisplay *disp, _EGLSurface *surf, if (dri2_dpy->vtbl->get_sync_values) ret = dri2_dpy->vtbl->get_sync_values(disp, surf, ust, msc, sbc); - mtx_unlock(&dri2_dpy->lock); - return ret; } @@ -2360,8 +2358,6 @@ dri2_query_surface(_EGLDisplay *disp, _EGLSurface *surf, ret = dri2_dpy->vtbl->query_surface(disp, surf, attribute, value); } - mtx_unlock(&dri2_dpy->lock); - return ret; }