summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2023-07-10 09:04:40 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2023-07-10 09:05:19 +1000
commit5e20d16dd4060a785358fd0860cf5bffd5b23c09 (patch)
treeca847709cac8718037e6583ad04dcdec837372aa
parent310db4206f2d2fc793e3044ee9886a20cc14ee86 (diff)
Don't try to enable a NULL device
If there is no other libinput device in our list (and next is thus NULL), skip the xf86AddEnabledDevice() call. Fixes #60
-rw-r--r--src/xf86libinput.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/xf86libinput.c b/src/xf86libinput.c
index f7a7553..934a312 100644
--- a/src/xf86libinput.c
+++ b/src/xf86libinput.c
@@ -1505,7 +1505,8 @@ swap_registered_device(InputInfoPtr pInfo)
input_lock();
xf86RemoveEnabledDevice(pInfo);
- xf86AddEnabledDevice(next);
+ if (next)
+ xf86AddEnabledDevice(next);
driver_context.registered_InputInfoPtr = next;
input_unlock();
}