For hotplugged devices, xf86AllocateInput does that for us but the xorg.conf
path is different. Since not all drivers reset the fd during PreInit but may
still call close(pInfo->fd) in all cases, this can terminate the logging
early.

Reproducible: add a wacom driver InputDevice section with no Option Device.

Signed-off-by: Peter Hutterer <[email protected]>
---
I would like to point out that 
http://lists.freedesktop.org/archives/xorg-devel/2011-July/023824.html and
http://lists.freedesktop.org/archives/xorg-devel/2011-July/023765.html are
equally unloved and nonetheless crash the server.

Jeremy: all three are 1.10.x candidates.

 hw/xfree86/common/xf86Config.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index ccfad95..7f3316a 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1223,6 +1223,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool 
implicitLayout)
                              (count + 1) * sizeof(InputInfoPtr));
             devs[count - 1] = xnfalloc(sizeof(InputInfoRec));
             Pointer.type_name = XI_MOUSE;
+            Pointer.fd = -1;
            *devs[count - 1] = Pointer;
            devs[count - 1]->options =
                                xf86addNewOption(devs[count -1]->options,
@@ -1269,6 +1270,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool 
implicitLayout)
                              (count + 1) * sizeof(InputInfoPtr));
             devs[count - 1] = xnfalloc(sizeof(InputInfoRec));
             Pointer.type_name = XI_MOUSE;
+            Pointer.fd = -1;
            *devs[count - 1] = Pointer;
            devs[count - 1]->options =
                                xf86addNewOption(NULL, xnfstrdup("AlwaysCore"), 
NULL);
@@ -1366,6 +1368,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool 
implicitLayout)
                              (count + 1) * sizeof(InputInfoPtr));
             devs[count - 1] = xnfalloc(sizeof(InputInfoRec));
             Keyboard.type_name = XI_KEYBOARD;
+            Keyboard.fd = -1;
            *devs[count - 1] = Keyboard;
            devs[count - 1]->options =
                                xf86addNewOption(devs[count - 1]->options,
-- 
1.7.6

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to