xfree86: Remove device from inputInfo.devices if ActivateDevice failed.
After the call to xf86ActivateDevice, the new device will be added to
inputInfo.devices. However, if the subsequent call to ActivateDevice
fails, the correponding InputInfoRec for the device is deleted but an
entry still remains in inputInfo.devices. This might lead to a server
crash later on (on InitAndStartDevices for instance) when the device
control proc would be called for an invalid device.
(cherry picked from commit efa31092d6
)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
24dc7694a2
commit
0df12a3f01
|
@ -543,7 +543,11 @@ xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable)
|
|||
dev = pInfo->dev;
|
||||
rval = ActivateDevice(dev);
|
||||
if (rval != Success)
|
||||
{
|
||||
xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", idev->identifier);
|
||||
RemoveDevice(dev);
|
||||
goto unwind;
|
||||
}
|
||||
|
||||
/* Enable it if it's properly initialised and we're currently in the VT */
|
||||
if (enable && dev->inited && dev->startup && xf86Screens[0]->vtSema)
|
||||
|
|
Loading…
Reference in New Issue
Block a user