[Mesa-dev] [PATCH 07/13] egl/drm: make use of the dri2_display_destroy() helper
Emil Velikov
emil.l.velikov at gmail.com
Thu May 11 18:57:51 UTC 2017
From: Emil Velikov <emil.velikov at collabora.com>
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
src/egl/drivers/dri2/platform_drm.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c
index 455225e56b0..80e824f3d54 100644
--- a/src/egl/drivers/dri2/platform_drm.c
+++ b/src/egl/drivers/dri2/platform_drm.c
@@ -679,6 +679,7 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
if (!dri2_dpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
+ dri2_dpy->fd = -1;
disp->DriverData = (void *) dri2_dpy;
gbm = disp->PlatformDisplay;
@@ -760,10 +761,6 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
return EGL_TRUE;
cleanup:
- if (fd >= 0)
- close(fd);
-
- free(dri2_dpy);
- disp->DriverData = NULL;
+ dri2_display_destroy(disp);
return _eglError(EGL_NOT_INITIALIZED, err);
}
--
2.12.2
More information about the mesa-dev
mailing list