Merge branches 'battery-scope', 'logitech' and 'multitouch' into for-linus
[~shefty/rdma-dev.git] / drivers / hid / hid-input.c
index af0200f061c0d95388f86860a348dcf7ec38a0e9..002781c5a6164040e90a6a5bab40ed982e50b508 100644 (file)
@@ -993,8 +993,13 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
                return;
        }
 
-       /* Ignore out-of-range values as per HID specification, section 5.10 */
-       if (value < field->logical_minimum || value > field->logical_maximum) {
+       /*
+        * Ignore out-of-range values as per HID specification,
+        * section 5.10 and 6.2.25
+        */
+       if ((field->flags & HID_MAIN_ITEM_VARIABLE) &&
+           (value < field->logical_minimum ||
+            value > field->logical_maximum)) {
                dbg_hid("Ignoring out-of-range value %x\n", value);
                return;
        }