From 12196d1b76898bc51ad55e2ad69689df35b29494 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tapani=20P=C3=A4lli?= Date: Fri, 12 May 2017 12:18:32 +0300 Subject: [PATCH] egl: check for driver_configs in dri2_display_release MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/egl/drivers/dri2/egl_dri2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.30.2