egl: fix leaking drmDevicePtr in _eglFindDevice

Fixes: 3a9e1014e1 ("egl: Rename _eglAddDevice() to _eglFindDevice()")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25524>
This commit is contained in:
Tapani Pälli
2023-10-23 08:01:31 +03:00
committed by Marge Bot
parent 3de5da7a5d
commit c7e522a9f3
+4 -1
View File
@@ -185,13 +185,16 @@ _eglFindDevice(int fd, bool software)
if (_eglDeviceSupports(dev, _EGL_DEVICE_DRM) &&
drmDevicesEqual(device, dev->device) != 0) {
goto out;
goto cleanup_drm;
}
}
/* Couldn't find an EGLDevice for the device. */
dev = NULL;
cleanup_drm:
drmFreeDevice(&device);
#else
_eglLog(_EGL_FATAL,
"Driver bug: Built without libdrm, yet looking for HW device");