From: Peter Hutterer Date: Sun, 24 Nov 2024 10:36:18 +0000 (+1000) Subject: touchpad: remove assert that may trigger during a race condition X-Git-Tag: 1.27.1~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d773056d2eda33c2da0ce2a9ce6d4278c0785da4;p=platform%2Fupstream%2Flibinput.git touchpad: remove assert that may trigger during a race condition There appears to be a race condition where an ABS_MT_TRACKING_ID -1 event is on the wire but libevdev_fetch_slot_value() for that slot already gives us -1 as well. If we just (re)opened our device, synching our slots would thus set zero active slots and then trigger the assert when that event is being processed. It's unclear how to reliably reproduce this issue but removing the assert and simply ignoring this event if we don't have active slots is correct anyway. Closes #1050 Part-of: --- diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index 9c219a68..d92b9eb0 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -546,8 +546,7 @@ tp_process_absolute(struct tp_dispatch *tp, if (e->value != -1) { tp->nactive_slots += 1; tp_new_touch(tp, t, time); - } else { - assert(tp->nactive_slots >= 1); + } else if (tp->nactive_slots >= 1) { tp->nactive_slots -= 1; tp_end_sequence(tp, t, time); }