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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user