summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2010-11-05 12:08:11 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2010-11-09 07:59:56 +1000
commit9e999d18b004b8ead9c6c5d79b4a3d4bbf0e3152 (patch)
treec55193583fd58709ff7490d01c69e9c7cb2fc443 /Xi
parent5a455e0c80d433adc4109ebf313fd92afa194545 (diff)
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>
Diffstat (limited to 'Xi')
-rw-r--r--Xi/xichangehierarchy.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c
index b7140d5e5..b9cdedf77 100644
--- a/Xi/xichangehierarchy.c
+++ b/Xi/xichangehierarchy.c
@@ -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);