From e4a2ce9f035a04878869256c74a19aa6795fc127 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 13 Jan 2017 11:48:49 +1000 Subject: [PATCH] udev: move check for seat_id down Don't access the struct until we've verified it is what we want. Signed-off-by: Peter Hutterer --- src/udev-seat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/udev-seat.c b/src/udev-seat.c index cdeb7fd6..d1eaed8b 100644 --- a/src/udev-seat.c +++ b/src/udev-seat.c @@ -375,14 +375,15 @@ libinput_udev_assign_seat(struct libinput *libinput, if (!seat_id) return -1; - if (input->seat_id != NULL) - return -1; if (libinput->interface_backend != &interface_backend) { log_bug_client(libinput, "Mismatching backends.\n"); return -1; } + if (input->seat_id != NULL) + return -1; + input->seat_id = strdup(seat_id); if (udev_input_enable(&input->base) < 0)