summaryrefslogtreecommitdiff
path: root/src/egl
diff options
context:
space:
mode:
authorTapani Pälli <tapani.palli@intel.com>2017-05-12 12:18:32 +0300
committerEmil Velikov <emil.l.velikov@gmail.com>2017-05-29 16:49:49 +0100
commit12196d1b76898bc51ad55e2ad69689df35b29494 (patch)
tree3bcd6e94bfd3b25e8cfe4580f917e981f2146160 /src/egl
parent628af2bc9690f42957f9799dfc0dbd0614d38d4c (diff)
egl: check for driver_configs in dri2_display_release
With later commits we'll split and reuse the destroy side of the function for the initialize_foo error path. In such cases, driver_configs may be NULL leading to a crash. Signed-off-by: Tapani Pälli <tapani.palli@intel.com> [Emil Velikov: reword commit message] Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Tested-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'src/egl')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 405db61d185..eefe3bfc583 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -919,7 +919,7 @@ dri2_display_release(_EGLDisplay *disp)
* the ones from the gbm device. As such the gbm itself is responsible
* for the cleanup.
*/
- if (disp->Platform != _EGL_PLATFORM_DRM) {
+ if (disp->Platform != _EGL_PLATFORM_DRM && dri2_dpy->driver_configs) {
for (i = 0; dri2_dpy->driver_configs[i]; i++)
free((__DRIconfig *) dri2_dpy->driver_configs[i]);
free(dri2_dpy->driver_configs);