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>
This commit is contained in:
parent
e1a3a1a0d8
commit
27011254c4
|
@ -444,6 +444,8 @@ ActivateDevice(DeviceIntPtr dev)
|
||||||
|
|
||||||
ret = (*dev->deviceProc) (dev, DEVICE_INIT);
|
ret = (*dev->deviceProc) (dev, DEVICE_INIT);
|
||||||
dev->inited = (ret == Success);
|
dev->inited = (ret == Success);
|
||||||
|
if (!dev->inited)
|
||||||
|
return ret;
|
||||||
|
|
||||||
/* Initialize memory for sprites. */
|
/* Initialize memory for sprites. */
|
||||||
if (dev->isMaster && dev->spriteInfo->spriteOwner)
|
if (dev->isMaster && dev->spriteInfo->spriteOwner)
|
||||||
|
|
|
@ -546,7 +546,10 @@ xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable)
|
||||||
}
|
}
|
||||||
|
|
||||||
dev = pInfo->dev;
|
dev = pInfo->dev;
|
||||||
ActivateDevice(dev);
|
rval = ActivateDevice(dev);
|
||||||
|
if (rval != Success)
|
||||||
|
goto unwind;
|
||||||
|
|
||||||
/* Enable it if it's properly initialised and we're currently in the VT */
|
/* Enable it if it's properly initialised and we're currently in the VT */
|
||||||
if (enable && dev->inited && dev->startup && xf86Screens[0]->vtSema)
|
if (enable && dev->inited && dev->startup && xf86Screens[0]->vtSema)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue