From fd21b282dc88936043a23baa4ec053a2811319a7 Mon Sep 17 00:00:00 2001 From: Jeff Smith Date: Sun, 4 Feb 2018 23:17:54 -0600 Subject: [PATCH] xfree86: Only call PreInit handler if it exists for device DoConfigure() attempts to call the PreInit handler on a device without checking that the handler exists. Check that the PreInit handler exists for a device before attempting to call it. Signed-off-by: Jeff Smith Reviewed-by: Adam Jackson --- hw/xfree86/common/xf86Configure.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c index 1b1928b17..44e759166 100644 --- a/hw/xfree86/common/xf86Configure.c +++ b/hw/xfree86/common/xf86Configure.c @@ -774,7 +774,8 @@ DoConfigure(void) ConfiguredMonitor = NULL; - if ((*xf86Screens[dev2screen[j]]->PreInit) (xf86Screens[dev2screen[j]], + if ((*xf86Screens[dev2screen[j]]->PreInit) && + (*xf86Screens[dev2screen[j]]->PreInit) (xf86Screens[dev2screen[j]], PROBE_DETECT) && ConfiguredMonitor) { monitor_ptr = configureDDCMonitorSection(j);