From: Jiri Kosina Date: Tue, 6 Jan 2015 21:34:19 +0000 (+0100) Subject: HID: fixup the conflicting keyboard mappings quirk X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8e7b341037db1835ee6eea64663013cbfcf33575;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git HID: fixup the conflicting keyboard mappings quirk The ignore check that got added in 6ce901eb61 ("HID: input: fix confusion on conflicting mappings") needs to properly check for VARIABLE reports as well (ARRAY reports should be ignored), otherwise legitimate keyboards might break. Cc: Fixes: 6ce901eb61 ("HID: input: fix confusion on conflicting mappings") Reported-by: Fredrik Hallenberg Reported-by: David Herrmann Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 84b6899ef3fd..a758900318ff 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -1113,6 +1113,7 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct */ if (!(field->flags & (HID_MAIN_ITEM_RELATIVE | HID_MAIN_ITEM_BUFFERED_BYTE)) && + (field->flags & HID_MAIN_ITEM_VARIABLE) && usage->usage_index < field->maxusage && value == field->value[usage->usage_index]) return;