st/gbm: don't segfault if the fail to create the screen
authorEmil Velikov <emil.l.velikov@gmail.com>
Wed, 23 Jul 2014 17:08:46 +0000 (18:08 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 30 Jul 2014 15:33:09 +0000 (16:33 +0100)
Whenever dd_create_screen/pipe_loader_* fails, gdrm->dev may be NULL.
Thus peeking inside the struct will lead to a crash.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
src/gallium/state_trackers/gbm/gbm_drm.c

index 077d51806c5cea16a39242b2a41cba0f33d86b6c..95b07eff901d597163527c15a884adeddba76436 100644 (file)
@@ -292,7 +292,7 @@ gbm_gallium_drm_device_create(int fd)
    return &gdrm->base.base;
 
 out_no_screen:
-   debug_printf("failed to load driver: %s\n", gdrm->dev->driver_name);
+   debug_printf("failed to load gallium_gbm\n");
 #if !GALLIUM_STATIC_TARGETS
    if (gdrm->dev)
       pipe_loader_release(&gdrm->dev, 1);