Skip to content
Commit 947992c7 authored by Max Staudt's avatar Max Staudt Committed by Jiri Kosina
Browse files

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: a48a7cd8 ("HID: playstation: DS4: Don't fail on calibration data request")
Signed-off-by: default avatarMax Staudt <max@enpas.org>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.com>
parent 8f607e00
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment