[Mesa-dev] [PATCH 2/6] st/gbm: don't segfault if the fail to create the screen

Emil Velikov emil.l.velikov at gmail.com
Wed Jul 23 17:43:34 PDT 2014


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 at gmail.com>
---
 src/gallium/state_trackers/gbm/gbm_drm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/gbm/gbm_drm.c b/src/gallium/state_trackers/gbm/gbm_drm.c
index 077d518..95b07ef 100644
--- a/src/gallium/state_trackers/gbm/gbm_drm.c
+++ b/src/gallium/state_trackers/gbm/gbm_drm.c
@@ -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);
-- 
2.0.2



More information about the mesa-dev mailing list