Skip to content

Commit a6f4f16

Browse files
JoseExpositoJiri Kosina
authored andcommitted
HID: uclogic: Fix frame templates for big endian architectures
When parsing a frame template with a placeholder indicating the number of buttons present on the frame its value was incorrectly set on big endian architectures due to double little endian conversion. In order to reproduce the issue and verify the fix, run the HID KUnit tests on the PowerPC architecture: $ ./tools/testing/kunit/kunit.py run --kunitconfig=drivers/hid \ --arch=powerpc --cross_compile=powerpc64-linux-gnu- Fixes: 867c892 ("HID: uclogic: Allow to generate frame templates") Signed-off-by: José Expósito <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent f77810f commit a6f4f16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/hid/hid-uclogic-rdesc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ __u8 *uclogic_rdesc_template_apply(const __u8 *template_ptr,
11931193
p[sizeof(btn_head)] < param_num) {
11941194
v = param_list[p[sizeof(btn_head)]];
11951195
put_unaligned((__u8)0x2A, p); /* Usage Maximum */
1196-
put_unaligned_le16((__force u16)cpu_to_le16(v), p + 1);
1196+
put_unaligned((__force u16)cpu_to_le16(v), (s16 *)(p + 1));
11971197
p += sizeof(btn_head) + 1;
11981198
} else {
11991199
p++;

0 commit comments

Comments
 (0)