backend-drm/drm-gbm: gbm_device_destroy on an invalid gbm device
When EGL initialization fails (failure to create a GLES3 or GLES2 context) we will end up calling gbm_device_destroy() twice, once in init_egl() and once in the drm_backend_create() error path.
Given that we should also take care of properly destroying the gbm device when we don't have any inputs for instance, mark the gbm device as NULL to avoid calling gbm_device_destroy() once more when destroying the DRM-backend.
Signed-off-by: Marius Vlad marius.vlad@collabora.com
Edited by Marius Vlad