Commit f47f78eb authored by Peter Hutterer's avatar Peter Hutterer

Ignore LED updates for disabled devices

If an XKB AccessX timeout is set and a VT switch is triggered, the
AccessXTimeoutExpire function may be called after the device has already been
disabled. This can cause a null-pointer dereference as our shared libinput
device may have been released by then.

In the legacy drivers this would've simply caused a write to an invalid fd
(-1), not a crash. Here we need to be more careful.

https://bugs.freedesktop.org/show_bug.cgi?id=98464Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 1c3ce3ce
...@@ -785,6 +785,9 @@ xf86libinput_kbd_ctrl(DeviceIntPtr device, KeybdCtrl *ctrl) ...@@ -785,6 +785,9 @@ xf86libinput_kbd_ctrl(DeviceIntPtr device, KeybdCtrl *ctrl)
struct xf86libinput *driver_data = pInfo->private; struct xf86libinput *driver_data = pInfo->private;
struct libinput_device *ldevice = driver_data->shared_device->device; struct libinput_device *ldevice = driver_data->shared_device->device;
if (!device->enabled)
return;
while (bits[i].xbit) { while (bits[i].xbit) {
if (ctrl->leds & bits[i].xbit) if (ctrl->leds & bits[i].xbit)
leds |= bits[i].code; leds |= bits[i].code;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment