Re: [PATCH] Input: always accept EV_SYN in input_event()
From: Jiri Kosina
Date: Fri Oct 16 2026 - 04:48:54 EST
On Sun, 11 Oct 2026, Dmitry Torokhov wrote:
> Commit 0cd587735205 ("Input: preallocate memory to hold event values")
> moved allocation of dev->vals into input_allocate_device(), which caused
> input core to accumulate events reported while seeding initial device
> state before input_register_device().
>
> However, because EV_SYN is only set in dev->evbit during
> input_register_device() (and some drivers also overwrite dev->evbit
> directly before registration), any EV_SYN/SYN_REPORT events sent before
> registration were dropped by is_event_supported(), leaving those seeded
> events stuck in dev->vals until the next SYN_REPORT after registration.
>
> Always accept EV_SYN in input_event() and input_inject_event() without
> checking dev->evbit so input_sync() flushes dev->vals as intended.
>
> Reported-by: Karlos Abel <kabel@xxxxxxxxxxxx>,
> Fixes: 0cd587735205 ("Input: preallocate memory to hold event values")
> Cc: stable@xxxxxxxxxxxxxxx
> Assisted-by: LLM
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
Makes sense to me, thanks. FWIW:
Acked-by: Jiri Kosina <jkosina@xxxxxxxx>
--
Jiri Kosina
SUSE Labs