From: Tapani Pälli Date: Fri, 12 May 2017 09:18:32 +0000 (+0300) Subject: egl: check for driver_configs in dri2_display_release X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=12196d1b76898bc51ad55e2ad69689df35b29494;p=mesa.git 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 [Emil Velikov: reword commit message] Signed-off-by: Emil Velikov Tested-by: Rob Herring --- 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);