From: Leandro Ribeiro Date: Mon, 4 Sep 2023 16:34:27 +0000 (-0300) Subject: egl: error out if we can't find an EGLDevice in _eglFindDevice() X-Git-Tag: upstream/23.3.3~663 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2be404f5571ada32d3b2e9cfe9b769846f27d68f;p=platform%2Fupstream%2Fmesa.git egl: error out if we can't find an EGLDevice in _eglFindDevice() Follow up of "egl/drm: get compatible render-only device fd for kms-only device". Now we can properly error out when we don't find the EGLDevice in _eglFindDevice(). Signed-off-by: Leandro Ribeiro Reviewed-by: Simon Ser Reviewed-by: Daniel Stone Part-of: --- diff --git a/src/egl/main/egldevice.c b/src/egl/main/egldevice.c index d4cc3d9..f8b7e94 100644 --- a/src/egl/main/egldevice.c +++ b/src/egl/main/egldevice.c @@ -153,6 +153,9 @@ _eglAddDRMDevice(drmDevicePtr device) /* Finds a device in DeviceList, for the given fd. * + * The fd must be of a render-capable device, as there are only render-capable + * devices in DeviceList. + * * If a software device, the fd is ignored. */ _EGLDevice * @@ -186,6 +189,9 @@ _eglFindDevice(int fd, bool software) } } + /* Couldn't find an EGLDevice for the device. */ + dev = NULL; + #else _eglLog(_EGL_FATAL, "Driver bug: Built without libdrm, yet looking for HW device");