mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 08:04:30 +00:00
Xi: if XTEST device creation fails, fail the master devices.
When getting close to the MAXDEVICES limit, the creation of XTEST devices may fail due to device id exhaustion. In that case, fail the creation of master devices too and return an error to the client. Theoretically, we could alloc the MDs without the XTEST devices but that will get interesting when a client starts sending XTEST events through those devices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org>
This commit is contained in:
@@ -157,7 +157,11 @@ add_master(ClientPtr client, xXIAddMasterInfo *c, int flags[MAXDEVICES])
|
||||
/* Allocate virtual slave devices for xtest events */
|
||||
rc = AllocXTestDevice(client, name, &XTestptr, &XTestkeybd, ptr, keybd);
|
||||
if (rc != Success)
|
||||
{
|
||||
DeleteInputDeviceRequest(ptr);
|
||||
DeleteInputDeviceRequest(keybd);
|
||||
goto unwind;
|
||||
}
|
||||
|
||||
ActivateDevice(ptr, FALSE);
|
||||
ActivateDevice(keybd, FALSE);
|
||||
|
||||
Reference in New Issue
Block a user