[PATCH weston 4/8] compositor-drm: Prevent a crash in the pixman renderer

Emmanuel Gil Peyrot emmanuel.peyrot at collabora.com
Mon May 2 21:40:13 UTC 2016


When pixman is used and no connector could be found (or any other
error), drm_backend_create() tried to destroy a gbm_device that would
only be created in init_egl(), resulting in a segfault.

Signed-off-by: Emmanuel Gil Peyrot <emmanuel.peyrot at collabora.com>
---
 src/compositor-drm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index c11562f..f9a997b 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -3227,7 +3227,8 @@ err_drm_source:
 err_udev_input:
 	udev_input_destroy(&b->input);
 err_sprite:
-	gbm_device_destroy(b->gbm);
+	if (b->gbm)
+		gbm_device_destroy(b->gbm);
 	destroy_sprites(b);
 err_udev_dev:
 	udev_device_unref(drm_device);
-- 
2.8.2



More information about the wayland-devel mailing list