From 8e2e275985619988f7d84010ab525bf27f3b9a88 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Sun, 15 Jan 2023 13:48:10 +1100 Subject: [PATCH] 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: (cherry picked from commit 0594b3c143d48c5f37f705abb03f18fbbabbc6b0) --- .pick_status.json | 2 +- src/egl/drivers/dri2/egl_dri2.c | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 04c1413..abec8a0 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1696,7 +1696,7 @@ "description": "egl/dri2: avoid undefined unlocks", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "f1efe037dfd82d95b025a3ddf58b669758b8d69a" }, diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 1f718b4..8e2767a 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -2452,8 +2452,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; } @@ -2578,8 +2576,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; } -- 2.7.4