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>
* 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);