summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-wiimote-modules.c
diff options
context:
space:
mode:
authorMax Staudt <max@enpas.org>2024-05-04 19:55:32 +0300
committerJiri Kosina <jkosina@suse.com>2024-05-07 00:31:24 +0300
commit947992c7fa9e0e7adf2451e7b7a88ce550248794 (patch)
tree4e32425f6b0adb8dbdaf32c013804ae528d8af25 /drivers/hid/hid-wiimote-modules.c
parent8f607e007e8127627680e2e5e2cd70da76fb45b1 (diff)
downloadlinux-947992c7fa9e0e7adf2451e7b7a88ce550248794.tar.xz
HID: playstation: DS4: Fix calibration workaround for clone devices
The logic in dualshock4_get_calibration_data() used uninitialised data in case of a failed kzalloc() for the transfer buffer. The solution is to group all business logic and all sanity checks together, and jump only to the latter in case of an error. While we're at it, factor out the axes' labelling, since it must happen either way for input_report_abs() to succeed later on. Thanks to Dan Carpenter for the Smatch static checker warning. Fixes: a48a7cd85f55 ("HID: playstation: DS4: Don't fail on calibration data request") Signed-off-by: Max Staudt <max@enpas.org> Signed-off-by: Jiri Kosina <jkosina@suse.com>
Diffstat (limited to 'drivers/hid/hid-wiimote-modules.c')
0 files changed, 0 insertions, 0 deletions