[PATCH xserver 3/3] xfree86: Only call PreInit handler if it exists for device

Jeff Smith whydoubt at gmail.com
Mon Feb 5 05:17:54 UTC 2018


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 <whydoubt at gmail.com>
---
 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 4026e3b5b..7deb86359 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -775,7 +775,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);
-- 
2.14.3



More information about the xorg-devel mailing list