egl/dri2: Fix missing return with dri2_egl_error_unlock.
authorVinson Lee <vlee@freedesktop.org>
Sun, 18 Sep 2022 18:02:04 +0000 (11:02 -0700)
committerMarge Bot <emma+marge@anholt.net>
Mon, 19 Sep 2022 16:24:08 +0000 (16:24 +0000)
Fix defect reported by Coverity Scan.

Double unlock (LOCK)
double_unlock: dri2_egl_error_unlock unlocks dri2_dpy->lock while it is unlocked.

Fixes: f1efe037dfd ("egl/dri2: Add display lock")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18655>

src/egl/drivers/dri2/egl_dri2.c

index ba3ea86..bb1c367 100644 (file)
@@ -2900,7 +2900,7 @@ dri2_query_dma_buf_modifiers(_EGLDisplay *disp, EGLint format,
       return dri2_egl_error_unlock(dri2_dpy, EGL_BAD_PARAMETER, "invalid value for max count of formats");
 
    if (max > 0 && modifiers == NULL)
-      dri2_egl_error_unlock(dri2_dpy, EGL_BAD_PARAMETER, "invalid modifiers array");
+      return dri2_egl_error_unlock(dri2_dpy, EGL_BAD_PARAMETER, "invalid modifiers array");
 
    if (dri2_dpy->image->base.version < 15 ||
        dri2_dpy->image->queryDmaBufModifiers == NULL) {