From: Emil Velikov Date: Wed, 23 Jul 2014 17:08:46 +0000 (+0100) Subject: st/gbm: don't segfault if the fail to create the screen X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e3a3dbe9407bdbf9693349900936d5349cb8bb75;p=mesa.git st/gbm: don't segfault if the fail to create the screen 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 --- diff --git a/src/gallium/state_trackers/gbm/gbm_drm.c b/src/gallium/state_trackers/gbm/gbm_drm.c index 077d51806c5..95b07eff901 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);