mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-26 04:16:39 +00:00
HID: uclogic: Fix frame templates for big endian architectures
commita6f4f16627
upstream. 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:867c892544
("HID: uclogic: Allow to generate frame templates") Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d91edca194
commit
d25f7d51cb
1 changed files with 1 additions and 1 deletions
|
@ -1119,7 +1119,7 @@ __u8 *uclogic_rdesc_template_apply(const __u8 *template_ptr,
|
|||
p[sizeof(btn_head)] < param_num) {
|
||||
v = param_list[p[sizeof(btn_head)]];
|
||||
put_unaligned((__u8)0x2A, p); /* Usage Maximum */
|
||||
put_unaligned_le16((__force u16)cpu_to_le16(v), p + 1);
|
||||
put_unaligned((__force u16)cpu_to_le16(v), (s16 *)(p + 1));
|
||||
p += sizeof(btn_head) + 1;
|
||||
} else {
|
||||
p++;
|
||||
|
|
Loading…
Reference in a new issue