summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2008-12-23 09:59:28 +1000
committerKeith Packard <keithp@keithp.com>2009-01-09 11:04:03 -0800
commit3c11efd7dc09aa92039f851c2bbf2ca6b5a5ac8c (patch)
tree4c128d08ee2081274e8c5fa50503d983ad55366e /dix
parent2ce48363b862db134624797bc071f8c45323a075 (diff)
xfree86: If an input device failed to activate, return immediately.
Devices are only activated once - right after they've been added to the server. If a device failes activation, it's dead. There's no reason to continue. Return the error code from ActivateDevice() without setting up sprite information or even sending a event to the client. Then - in the DDX - just remove the device again. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 27011254c4de4e573a0851bf46892fb488db6522)
Diffstat (limited to 'dix')
-rw-r--r--dix/devices.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/dix/devices.c b/dix/devices.c
index f7fef95ab..6b0505028 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -446,6 +446,8 @@ ActivateDevice(DeviceIntPtr dev)
ret = (*dev->deviceProc) (dev, DEVICE_INIT);
dev->inited = (ret == Success);
+ if (!dev->inited)
+ return ret;
/* Initialize memory for sprites. */
if (dev->isMaster && dev->spriteInfo->spriteOwner)