diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-04-23 10:08:48 +0930 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-04-23 10:08:48 +0930 |
commit | ba65c34068a836ae393565a6a8260a4e96709816 (patch) | |
tree | 7bf959c46149514dc73a16f07c1cf54213df95a4 /src/evdev.c | |
parent | Remove direct call to DEVICE_INIT, ActivateDevice() takes care of that. (diff) | |
download | xf86-input-evdev-ba65c34068a836ae393565a6a8260a4e96709816.tar.gz xf86-input-evdev-ba65c34068a836ae393565a6a8260a4e96709816.tar.bz2 xf86-input-evdev-ba65c34068a836ae393565a6a8260a4e96709816.zip |
Remove driver from list if no device is associated any more.
This effectively stops the driver from hotplugging new devices. Devices have
to be added with the dbus hotplugging events.
Diffstat (limited to 'src/evdev.c')
-rw-r--r-- | src/evdev.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/evdev.c b/src/evdev.c index f506997..5455062 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -461,6 +461,14 @@ EvdevCorePreInit(InputDriverPtr drv, IDevPtr dev, int flags) if (pEvdev->devices && pEvdev->devices->pInfo) return pEvdev->devices->pInfo; + /* In some cases pEvdev->devices is NULL, but on the next + * evdevRescanDevices the device suddenly appears. If we return NULL here, + * the server will clean up and the sudden appearance of the device will + * segfault. We need to remove the driver from the list to avoid this. + * No. I don't know why it just appears. (whot) + */ + evdevRemoveDriver(pEvdev); + return NULL; } |