Fix crasher due to missing devnode after resume (#1536633)
This commit is contained in:
parent
b1b6782406
commit
2e5d33a53e
@ -0,0 +1,47 @@
|
||||
From cb186abc17ad9e525609dc32385b0a7992e949a9 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Date: Fri, 9 Feb 2018 19:24:15 +1000
|
||||
Subject: [PATCH libinput] evdev: fail before open_restricted if the devnode
|
||||
doesn't exist
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1536633
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1539046
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1539783
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1540662
|
||||
https://bugs.freedesktop.org/show_bug.cgi?id=104278
|
||||
|
||||
Debugged-by: Jeff Smith <whydoubt@gmail.com>
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
---
|
||||
src/evdev.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/src/evdev.c b/src/evdev.c
|
||||
index d1ca243d..63b93ec3 100644
|
||||
--- a/src/evdev.c
|
||||
+++ b/src/evdev.c
|
||||
@@ -1917,6 +1917,11 @@ evdev_device_create(struct libinput_seat *seat,
|
||||
const char *devnode = udev_device_get_devnode(udev_device);
|
||||
const char *sysname = udev_device_get_sysname(udev_device);
|
||||
|
||||
+ if (!devnode) {
|
||||
+ log_info(libinput, "%s: no device node associated\n", sysname);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
if (udev_device_should_be_ignored(udev_device)) {
|
||||
log_debug(libinput, "%s: device is ignored\n", sysname);
|
||||
return NULL;
|
||||
@@ -2434,6 +2439,9 @@ evdev_device_resume(struct evdev_device *device)
|
||||
return -ENODEV;
|
||||
|
||||
devnode = udev_device_get_devnode(device->udev_device);
|
||||
+ if (!devnode)
|
||||
+ return -ENODEV;
|
||||
+
|
||||
fd = open_restricted(libinput, devnode,
|
||||
O_RDWR | O_NONBLOCK | O_CLOEXEC);
|
||||
|
||||
--
|
||||
2.14.3
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
Name: libinput
|
||||
Version: 1.10.0
|
||||
Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
|
||||
Release: 2%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
|
||||
Summary: Input device library
|
||||
|
||||
License: MIT
|
||||
@ -18,6 +18,8 @@ Source2: commitid
|
||||
Source0: http://www.freedesktop.org/software/libinput/libinput-%{version}.tar.xz
|
||||
%endif
|
||||
|
||||
Patch01: 0001-evdev-fail-before-open_restricted-if-the-devnode-doe.patch
|
||||
|
||||
BuildRequires: git-core
|
||||
BuildRequires: gcc
|
||||
BuildRequires: meson
|
||||
@ -109,6 +111,9 @@ The %{name}-utils package contains tools to debug hardware and analyze
|
||||
%{_mandir}/man1/libinput-measure-trackpoint-range.1*
|
||||
|
||||
%changelog
|
||||
* Tue Feb 13 2018 Peter Hutterer <peter.hutterer@redhat.com> 1.10.0-2
|
||||
- Fix crasher due to missing devnode after resume (#1536633)
|
||||
|
||||
* Tue Feb 13 2018 Peter Hutterer <peter.hutterer@redhat.com> 1.10.0-1
|
||||
- libinput 1.10
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user