From bfeff2c687d8c4f5ddd04792ed51dc0c03b22435 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sun, 6 Jun 2021 08:43:28 -0700 Subject: [PATCH] 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 Reviewed-by: Emma Anholt Part-of: --- 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 df0a001..17e36af 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 -- 2.7.4