From 3e2cb5b5cf34df1d5bcc0fd02ba79ffb989c5c9f Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Sat, 12 Aug 2017 15:13:29 +0200 Subject: libinput: fix segfault when handling non-wlr device removal --- backend/libinput/events.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'backend') diff --git a/backend/libinput/events.c b/backend/libinput/events.c index 9afdab21..aa5c315d 100644 --- a/backend/libinput/events.c +++ b/backend/libinput/events.c @@ -112,6 +112,9 @@ static void handle_device_added(struct wlr_backend_state *state, static void handle_device_removed(struct wlr_backend_state *state, struct libinput_device *device) { list_t *devices = libinput_device_get_user_data(device); + if (!devices) { + return; + } for (size_t i = 0; i < devices->length; i++) { struct wlr_input_device *wlr_device = devices->items[i]; wlr_log(L_DEBUG, "Removing %s [%d:%d]", wlr_device->name, -- cgit v1.2.3