Skip to content

Commit 5989a55

Browse files
jigpuJiri Kosina
authored andcommitted
HID: input: Fix TransducerSerialNumber implementation
The commit which introduced TransducerSerialNumber (368c966) is missing two crucial implementation details. Firstly, the commit does not set the type/code/bit/max fields as expected later down the code which can cause the driver to crash when a tablet with this usage is connected. Secondly, the call to 'set_bit' causes MSC_PULSELED to be sent instead of the expected MSC_SERIAL. This commit addreses both issues. Signed-off-by: Jason Gerecke <[email protected]> Reviewed-by: Benjamin Tissoires <[email protected]> Reviewed-by: Ping Cheng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent f974008 commit 5989a55

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/hid/hid-input.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
695695
break;
696696

697697
case 0x5b: /* TransducerSerialNumber */
698-
set_bit(MSC_SERIAL, input->mscbit);
698+
usage->type = EV_MSC;
699+
usage->code = MSC_SERIAL;
700+
bit = input->mscbit;
701+
max = MSC_MAX;
699702
break;
700703

701704
default: goto unknown;

0 commit comments

Comments
 (0)