From a3ea7a680870081e623942e6714b44c47e310085 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 6 Jun 2019 10:29:35 +1000 Subject: [PATCH] udev: don't init the quirks until we checked all arguments If we fail with an invalid argument, there's no need to initialize all the quirks beforehand. Signed-off-by: Peter Hutterer --- src/udev-seat.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/udev-seat.c b/src/udev-seat.c index fd50488a..b548dfe7 100644 --- a/src/udev-seat.c +++ b/src/udev-seat.c @@ -391,13 +391,6 @@ libinput_udev_assign_seat(struct libinput *libinput, return -1; } - /* We cannot do this during udev_create_context because the log - * handler isn't set up there but we really want to log to the right - * place if the quirks run into parser errors. So we have to do it - * here since we can expect the log handler to be set up by now. - */ - libinput_init_quirks(libinput); - if (libinput->interface_backend != &interface_backend) { log_bug_client(libinput, "Mismatching backends.\n"); return -1; @@ -406,6 +399,13 @@ libinput_udev_assign_seat(struct libinput *libinput, if (input->seat_id != NULL) return -1; + /* We cannot do this during udev_create_context because the log + * handler isn't set up there but we really want to log to the right + * place if the quirks run into parser errors. So we have to do it + * here since we can expect the log handler to be set up by now. + */ + libinput_init_quirks(libinput); + input->seat_id = safe_strdup(seat_id); if (udev_input_enable(&input->base) < 0)