Skip to contentSkip to conversation

HID: input: Fix parsing of HID_CP_CONSUMER_CONTROL fields

PATCH Applied Hans de Goede 3 participants 3 messages Oct 28, 2021 – Nov 19, 2021 HID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: input: Fix parsing of HID_CP_CONSUMER_CONTROL fields

Fix parsing of HID_CP_CONSUMER_CONTROL fields which are not in the HID_CP_PROGRAMMABLEBUTTONS collection.

Fixes bcfa8d14570d ("HID: input: Add support for Programmable Buttons")
Cc Thomas Weißschuh <[email protected]>
---
 drivers/hid/hid-input.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/hid/hid-input.c +2 -3
index 4b5ebeacd283..4b3f4a5e2305 100644
@@ -650,10 +650,9 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 						code += KEY_MACRO1;
 					else
 						code += BTN_TRIGGER_HAPPY - 0x1e;
-				} else {
-					goto ignore;
+					break;
 				}
-				break;
+				fallthrough;
 		default:
 			switch (field->physical) {
 			case HID_GD_MOUSE:
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 31 lines · Hans de Goede

Fix parsing of HID_CP_CONSUMER_CONTROL fields which are not in the HID_CP_PROGRAMMABLEBUTTONS collection.

Fixes bcfa8d14570d ("HID: input: Add support for Programmable Buttons")
Cc Thomas Weißschuh <[email protected]>
---
 drivers/hid/hid-input.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/hid/hid-input.c +2 -3
index 4b5ebeacd283..4b3f4a5e2305 100644
@@ -650,10 +650,9 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 						code += KEY_MACRO1;
 					else
 						code += BTN_TRIGGER_HAPPY - 0x1e;
-				} else {
-					goto ignore;
+					break;
 				}
-				break;
+				fallthrough;
 		default:
 			switch (field->physical) {
 			case HID_GD_MOUSE:
Signature · 1 line
2.31.1

Although looking at the descriptor I'm not sure that what it does is correct.

FYI I have another patch in the pipeline that fixes broken keymap remapping for ignored keys.
Such a remapping via the hwdb would have been another, maybe more correct, way to fix this issue.

maintainer Applied
#2 lore raw
In reply to Hans de Goede
Quoted 8 lines · Hans de Goede

Fix parsing of HID_CP_CONSUMER_CONTROL fields which are not in the HID_CP_PROGRAMMABLEBUTTONS collection.

Fixes bcfa8d14570d ("HID: input: Add support for Programmable Buttons")
Cc Thomas Weißschuh <[email protected]>

Applied, thanks Hans.

Signature · 2 lines
Jiri Kosina
SUSE Labs