Dmitry Torokhov 071b24b54d 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>
2024-11-02 22:28:58 -07:00
..
2024-07-26 11:04:28 -07:00
2024-07-27 15:28:53 -07:00
2024-07-27 12:46:16 -07:00
2024-07-20 12:41:03 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-09-01 06:42:13 +12:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-08-19 11:02:13 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-07-27 10:53:06 -07:00
2024-07-19 09:59:58 -07:00
2024-08-31 06:11:34 +12:00
2024-07-17 17:51:30 -07:00
2024-07-25 10:42:22 -07:00
2024-08-16 14:03:31 -07:00
2024-08-15 10:23:19 -07:00
2024-07-25 10:42:22 -07:00
2024-07-27 12:46:16 -07:00
2024-08-18 10:16:34 -07:00
2024-07-25 10:42:22 -07:00
2024-08-28 16:54:45 -07:00
2024-07-25 10:42:22 -07:00
2024-08-22 13:28:40 -07:00
2024-07-25 10:42:22 -07:00
2024-08-31 14:54:11 +12:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-08-29 07:12:02 +12:00
2024-07-25 10:42:22 -07:00
2024-07-27 12:27:52 -07:00
2024-07-23 13:41:59 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-08-25 12:05:23 +12:00
2024-09-01 07:00:38 +12:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-08-28 20:27:39 +00:00
2024-08-23 07:43:15 +08:00
2024-07-25 10:42:22 -07:00
2024-09-01 07:06:28 +12:00
2024-07-29 12:53:37 -07:00
2024-07-25 10:42:22 -07:00
2024-08-06 10:58:28 -07:00
2024-07-20 12:41:03 -07:00
2024-07-29 12:53:37 -07:00
2024-07-25 10:18:35 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00