summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/egl/drivers/dri2/platform_surfaceless.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/egl/drivers/dri2/platform_surfaceless.c b/src/egl/drivers/dri2/platform_surfaceless.c
index 210f8188b96..8eeb2d4ed43 100644
--- a/src/egl/drivers/dri2/platform_surfaceless.c
+++ b/src/egl/drivers/dri2/platform_surfaceless.c
@@ -294,8 +294,9 @@ surfaceless_probe_device(_EGLDisplay *disp, bool swrast)
* are unavailable since 6c5ab, and kms_swrast is more
* feature complete than swrast.
*/
- if (strcmp(driver_name, "vgem") == 0 ||
- strcmp(driver_name, "virtio_gpu") == 0)
+ if (driver_name &&
+ (strcmp(driver_name, "vgem") == 0 ||
+ strcmp(driver_name, "virtio_gpu") == 0))
dri2_dpy->driver_name = strdup("kms_swrast");
free(driver_name);
} else {