@@ -1157,12 +1157,15 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
* don't specify logical min and max.
*/
if ((field->flags & HID_MAIN_ITEM_VARIABLE) &&
- (field->flags & HID_MAIN_ITEM_NULL_STATE) &&
(field->logical_minimum < field->logical_maximum) &&
(value < field->logical_minimum ||
value > field->logical_maximum)) {
- dbg_hid("Ignoring out-of-range value %x\n", value);
- return;
+ if (field->flags & HID_MAIN_ITEM_NULL_STATE) {
+ dbg_hid("Ignoring out-of-range value %x\n", value);
+ return;
+ }
+ value = value < field->logical_minimum ?
+ field->logical_minimum : field->logical_maximum;
}
/*