From c754162a36097fb63402b794bb6cb6cd4ff47456 Mon Sep 17 00:00:00 2001 From: fish4terrisa-MSDSM Date: Fri, 11 Jul 2025 16:00:42 +0800 Subject: [PATCH] modesetting: ignore the drmmode if p->atoms is null Some display drivers might cause p->atoms to be null if the display is disabled. This will cause segfault when checking if p->atoms[0] != property . Some display drivers owned by qualcomm is known to cause this bug. Signed-off-by: fish4terrisa-MSDSM --- hw/xfree86/drivers/modesetting/drmmode_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c index f28c3596b9..8ef8574377 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -3178,7 +3178,7 @@ drmmode_output_set_property(xf86OutputPtr output, Atom property, for (i = 0; i < drmmode_output->num_props; i++) { drmmode_prop_ptr p = &drmmode_output->props[i]; - if (p->atoms[0] != property) + if (p->atoms && p->atoms[0] != property) continue; if (p->mode_prop->flags & DRM_MODE_PROP_RANGE) {