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 <whydoubt@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Jeff Smith 2018-02-04 23:17:54 -06:00 committed by Adam Jackson
parent e81031f3fd
commit fd21b282dc

View File

@ -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);