Dan Carpenter 6c667ef6e2 HID: steelseries: Fix signedness bug in steelseries_headset_arctis_1_fetch_battery()
The hid_hw_raw_request() function returns negative error codes or the
number bytes transferred.  The problem is that when it returns negative
error codes and we check if "ret < sizeof(arctis_1_battery_request)",
then the negative values are type promoted from int to high unsigned long
values and treated as success.

This was detected using Smatch:

    drivers/hid/hid-steelseries.c:393 steelseries_headset_arctis_1_fetch_battery()
    warn: error code type promoted to positive: 'ret'

Fixes: a0c76896c3fb ("HID: steelseries: Add support for Arctis 1 XBox")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-09-18 16:44:24 +02:00
..
2023-09-01 09:53:54 -07:00
2023-09-01 09:43:18 -07:00
2023-09-01 09:53:54 -07:00
2023-09-01 09:53:54 -07:00
2023-08-31 12:43:10 -07:00
2023-09-01 09:38:00 -07:00
2023-09-01 12:21:32 -07:00
2023-09-01 09:53:54 -07:00
2023-08-30 20:41:37 -07:00
2023-09-01 09:16:47 -07:00
2023-08-31 12:43:10 -07:00
2023-09-01 12:21:32 -07:00
2023-09-01 09:53:54 -07:00
2023-09-01 09:38:00 -07:00
2023-08-31 12:47:15 +02:00
2023-09-01 09:38:00 -07:00
2023-08-31 12:43:10 -07:00
2023-09-01 12:21:32 -07:00
2023-09-01 09:38:00 -07:00
2023-09-01 09:38:00 -07:00
2023-08-30 20:41:37 -07:00