Fix crash when we have multiple keyboard event listeners for the lid

switch (#1440927)
This commit is contained in:
Peter Hutterer 2017-05-04 15:13:33 +10:00
parent fa48f8fad7
commit 4e5ee47860
2 changed files with 60 additions and 1 deletions

View File

@ -0,0 +1,53 @@
From 72d597502c3bbf3462887c23afd2f184314409e8 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Thu, 4 May 2017 14:50:31 +1000
Subject: [PATCH libinput] lid: re-init the event listener after removing it
We may call remove on it again and that segfaults if it hasn't been
initialized.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 3735359f0c66208658754e2c2b5f7e7041a2e290)
---
src/evdev-lid.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/evdev-lid.c b/src/evdev-lid.c
index 8db7f37c..e71499bb 100644
--- a/src/evdev-lid.c
+++ b/src/evdev-lid.c
@@ -98,7 +98,9 @@ lid_switch_toggle_keyboard_listener(struct lid_switch_dispatch *dispatch,
dispatch);
} else {
libinput_device_remove_event_listener(
- &dispatch->keyboard.listener);
+ &dispatch->keyboard.listener);
+ libinput_device_init_event_listener(
+ &dispatch->keyboard.listener);
}
}
@@ -197,7 +199,9 @@ lid_switch_pair_keyboard(struct evdev_device *lid_switch,
if (dispatch->keyboard.keyboard) {
if (bus_kbd != BUS_I8042)
return;
+
libinput_device_remove_event_listener(&dispatch->keyboard.listener);
+ libinput_device_init_event_listener(&dispatch->keyboard.listener);
}
dispatch->keyboard.keyboard = keyboard;
@@ -225,7 +229,9 @@ lid_switch_interface_device_removed(struct evdev_device *device,
if (removed_device == dispatch->keyboard.keyboard) {
libinput_device_remove_event_listener(
- &dispatch->keyboard.listener);
+ &dispatch->keyboard.listener);
+ libinput_device_init_event_listener(
+ &dispatch->keyboard.listener);
dispatch->keyboard.keyboard = NULL;
}
}
--
2.12.2

View File

@ -5,7 +5,7 @@
Name: libinput
Version: 1.7.1
Release: 2%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
Release: 3%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
Summary: Input device library
License: MIT
@ -18,11 +18,13 @@ Source2: commitid
Source0: http://www.freedesktop.org/software/libinput/libinput-%{version}.tar.xz
%endif
Patch01: 0001-touchpad-move-the-pressure-range-to-a-hwdb-entry.patch
Patch02: 0002-doc-add-documentation-for-touchpad-pressure-detectio.patch
Patch03: 0003-udev-Remove-unused-Elantech-touchpad-model-binding.patch
Patch04: 0004-udev-Select-more-generic-pressure-range-values-for-E.patch
Patch05: 0005-udev-Add-specific-pressure-range-for-the-ASUS-ZenBoo.patch
Patch06: 0001-lid-re-init-the-event-listener-after-removing-it.patch
BuildRequires: git
BuildRequires: autoconf automake libtool pkgconfig
@ -100,6 +102,10 @@ find $RPM_BUILD_ROOT -name '*.la' -delete
%changelog
* Thu May 04 2017 Peter Hutterer <peter.hutterer@redhat.com> 1.7.1-3
- Fix crash when we have multiple keyboard event listeners for the lid
switch (#1440927)
* Tue May 02 2017 Peter Hutterer <peter.hutterer@redhat.com> 1.7.1-2
- Add patches to fix elantech pressure detection