diff options
Diffstat (limited to 'drivers/hid/hid-input.c')
-rw-r--r-- | drivers/hid/hid-input.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 9333d692a786..627850a54d34 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
@@ -986,8 +986,13 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct | |||
986 | return; | 986 | return; |
987 | } | 987 | } |
988 | 988 | ||
989 | /* Ignore out-of-range values as per HID specification, section 5.10 */ | 989 | /* |
990 | if (value < field->logical_minimum || value > field->logical_maximum) { | 990 | * Ignore out-of-range values as per HID specification, |
991 | * section 5.10 and 6.2.25 | ||
992 | */ | ||
993 | if ((field->flags & HID_MAIN_ITEM_VARIABLE) && | ||
994 | (value < field->logical_minimum || | ||
995 | value > field->logical_maximum)) { | ||
991 | dbg_hid("Ignoring out-of-range value %x\n", value); | 996 | dbg_hid("Ignoring out-of-range value %x\n", value); |
992 | return; | 997 | return; |
993 | } | 998 | } |