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 <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2017-01-13 11:48:49 +10:00
parent 5d66edc9f4
commit e4a2ce9f03

View file

@ -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)