Centos-kernel-stream-9/drivers/input
Benjamin Tissoires 2c98a341ed Input: fix regression when re-registering input handlers
JIRA: https://issues.redhat.com/browse/RHEL-53898
Upstream Status: since v6.12
Tested: with the hid-tools test suite and some hardware

commit 071b24b54d2d05fbf39ddbb27dee08abd1d713f3
Author: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date:   Sun Oct 27 22:31:15 2024 -0700

    Input: fix regression when re-registering input handlers

    Commit d469647bafd9 ("Input: simplify event handling logic") introduced
    code that would set handler->events() method to either
    input_handler_events_filter() or input_handler_events_default() or
    input_handler_events_null(), depending on the kind of input handler
    (a filter or a regular one) we are dealing with. Unfortunately this
    breaks cases when we try to re-register the same filter (as is the case
    with sysrq handler): after initial registration the handler will have 2
    event handling methods defined, and will run afoul of the check in
    input_handler_check_methods():

            input: input_handler_check_methods: only one event processing method can be defined (sysrq)
            sysrq: Failed to register input handler, error -22

    Fix this by adding handle_events() method to input_handle structure and
    setting it up when registering a new input handle according to event
    handling methods defined in associated input_handler structure, thus
    avoiding modifying the input_handler structure.

    Reported-by: "Ned T. Crigler" <crigler@gmail.com>
    Reported-by: Christian Heusel <christian@heusel.eu>
    Tested-by: "Ned T. Crigler" <crigler@gmail.com>
    Tested-by: Peter Seiderer <ps.report@gmx.net>
    Fixes: d469647bafd9 ("Input: simplify event handling logic")
    Link: https://lore.kernel.org/r/Zx2iQp6csn42PJA7@xavtug
    Cc: stable@vger.kernel.org
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2024-12-12 14:06:02 +01:00
..
gameport
joystick
keyboard Merge: drivers: media: media rebase to upstream 6.11 2024-12-11 14:23:20 +00:00
misc Input: uinput - reject requests with unreasonable number of slots 2024-12-12 14:05:37 +01:00
mouse Input: synaptics - enable SMBus for HP Elitebook 840 G2 2024-12-12 14:05:37 +01:00
rmi4 Input: synaptics-rmi4 - fail probing if memory allocation for "phys" fails 2024-06-17 14:25:57 +02:00
serio Input: i8042 - use new forcenorestore quirk to replace old buggy quirk combination 2024-12-12 14:05:38 +01:00
tablet
tests
touchscreen media: videobuf2: core: Rename min_buffers_needed field in vb2_queue 2024-11-27 09:40:46 +08:00
Kconfig
Makefile
apm-power.c
evbug.c
evdev.c Input: make events() method return number of events processed 2024-12-12 14:05:36 +01:00
ff-core.c
ff-memless.c
input-compat.c
input-compat.h
input-core-private.h
input-leds.c Input: leds - annotate struct input_leds with __counted_by 2024-06-17 14:25:51 +02:00
input-mt.c Input: MT - limit max slots 2024-12-12 14:05:37 +01:00
input-poller.c
input-poller.h
input.c Input: fix regression when re-registering input handlers 2024-12-12 14:06:02 +01:00
joydev.c
matrix-keymap.c
mousedev.c
sparse-keymap.c
touchscreen.c
vivaldi-fmap.c