[PATCH] HID: input: Fix parsing of HID_CP_CONSUMER_CONTROL fields

Subsystems: hid core layer, the rest

STALE1736d

3 messages, 3 authors, 2021-11-19 · open the first message on its own page

[PATCH] HID: input: Fix parsing of HID_CP_CONSUMER_CONTROL fields

From: Hans de Goede <hidden>
Date: 2021-10-28 16:33:52

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")
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2018096
Cc: Thomas Weißschuh <linux@weissschuh.net>
Suggested-by: Benjamin Tissoires <redacted>
Signed-off-by: Hans de Goede <redacted>
---
 drivers/hid/hid-input.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 4b5ebeacd283..4b3f4a5e2305 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -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:
-- 
2.31.1

Re: [PATCH] HID: input: Fix parsing of HID_CP_CONSUMER_CONTROL fields

From: Thomas Weißschuh <linux@weissschuh.net>
Date: 2021-10-28 17:15:48

On 2021-10-28 18:33+0200, Hans de Goede wrote:
quoted hunk
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")
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2018096
Cc: Thomas Weißschuh <linux@weissschuh.net>
Suggested-by: Benjamin Tissoires <redacted>
Signed-off-by: Hans de Goede <redacted>
---
 drivers/hid/hid-input.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 4b5ebeacd283..4b3f4a5e2305 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -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:
-- 
2.31.1
Reviewed-By: Thomas Weißschuh <linux@weissschuh.net>

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.

Re: [PATCH] HID: input: Fix parsing of HID_CP_CONSUMER_CONTROL fields

From: Jiri Kosina <jikos@kernel.org>
Date: 2021-11-19 14:47:53

On Thu, 28 Oct 2021, Hans de Goede wrote:
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")
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2018096
Cc: Thomas Weißschuh <linux@weissschuh.net>
Suggested-by: Benjamin Tissoires <redacted>
Signed-off-by: Hans de Goede <redacted>
Applied, thanks Hans.

-- 
Jiri Kosina
SUSE Labs
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help