Skip to content

Commit 843d428

Browse files
Valtteri Heikkilägregkh
authored andcommitted
HID: reject input outside logical range only if null state is set
[ Upstream commit 3f3752705dbd50b66b66ad7b4d54fe33d2f746ed ] This patch fixes an issue in drivers/hid/hid-input.c where USB HID control null state flag is not checked upon rejecting inputs outside logical minimum-maximum range. The check should be made according to USB HID specification 1.11, section 6.2.2.5, p.31. The fix will resolve issues with some game controllers, such as: https://bugzilla.kernel.org/show_bug.cgi?id=68621 [[email protected]: shortened and fixed spelling in commit message] Signed-off-by: Valtteri Heikkilä <[email protected]> Signed-off-by: Tomasz Kramkowski <[email protected]> Acked-By: Benjamin Tissoires <[email protected]> Signed-off-by: Jiri Kosina <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0ca7c40 commit 843d428

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/hid/hid-input.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,6 +1097,7 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
10971097
* don't specify logical min and max.
10981098
*/
10991099
if ((field->flags & HID_MAIN_ITEM_VARIABLE) &&
1100+
(field->flags & HID_MAIN_ITEM_NULL_STATE) &&
11001101
(field->logical_minimum < field->logical_maximum) &&
11011102
(value < field->logical_minimum ||
11021103
value > field->logical_maximum)) {

0 commit comments

Comments
 (0)