]> git.baikalelectronics.ru Git - kernel.git/commit
HID: surface-hid: Fix integer endian conversion
authorMaximilian Luz <luzmaximilian@gmail.com>
Sun, 11 Apr 2021 11:34:02 +0000 (13:34 +0200)
committerJiri Kosina <jkosina@suse.cz>
Wed, 5 May 2021 12:31:55 +0000 (14:31 +0200)
commit863699267e0ea40f5402c25aa49a025d9b9175de
treee6ce720d17cb5f36f60749b591fa923475743726
parentd3843d419cbd4e5b5104f1f85052c7e1ed6e8257
HID: surface-hid: Fix integer endian conversion

We want to convert from 16 bit (unsigned) little endian values contained
in a packed struct to CPU native endian values here, not the other way
around. So replace cpu_to_le16() with get_unaligned_le16(), using the
latter instead of le16_to_cpu() to acknowledge that we are reading from
a packed struct.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: cb22ab305a4f ("HID: Add support for Surface Aggregator Module HID transport")
Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/surface-hid/surface_hid_core.c