Mesa (main): egl: zero is a valid fd

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 7 20:44:49 UTC 2021


Module: Mesa
Branch: main
Commit: bfeff2c687d8c4f5ddd04792ed51dc0c03b22435
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bfeff2c687d8c4f5ddd04792ed51dc0c03b22435

Author: Rob Clark <robdclark at chromium.org>
Date:   Sun Jun  6 08:43:28 2021 -0700

egl: zero is a valid fd

We shouldn't be using RETURN_EGL_EVAL() for eglDupNativeFenceFDANDROID()
return, as (while perhaps unlikely) zero is a valid fd.  The error case
for EGL_NO_NATIVE_FENCE_FD_ANDROID is already handled in egl_dri2.c
(dri2_dup_native_fence_fd()) so just use RETURN_EGL_SUCCESS() instead.

Also fix ret type.

Fixes: 0201f01dc4e ("egl: add EGL_ANDROID_native_fence_sync")
Signed-off-by: Rob Clark <robdclark at chromium.org>
Reviewed-by: Emma Anholt <emma at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11202>

---

 src/egl/main/eglapi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index df0a0011dbf..17e36af22e1 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -2144,7 +2144,7 @@ eglDupNativeFenceFDANDROID(EGLDisplay dpy, EGLSync sync)
 {
    _EGLDisplay *disp = _eglLockDisplay(dpy);
    _EGLSync *s = _eglLookupSync(sync, disp);
-   EGLBoolean ret;
+   EGLint ret;
 
    _EGL_FUNC_START(disp, EGL_OBJECT_SYNC_KHR, s, EGL_FALSE);
 
@@ -2159,7 +2159,7 @@ eglDupNativeFenceFDANDROID(EGLDisplay dpy, EGLSync sync)
    assert(disp->Extensions.ANDROID_native_fence_sync);
    ret = disp->Driver->DupNativeFenceFDANDROID(disp, s);
 
-   RETURN_EGL_EVAL(disp, ret);
+   RETURN_EGL_SUCCESS(disp, ret);
 }
 
 static EGLBoolean EGLAPIENTRY



More information about the mesa-commit mailing list