diff options
author | Hans de Goede <[email protected]> | 2019-07-29 17:50:36 +0200 |
---|---|---|
committer | Jiri Kosina <[email protected]> | 2019-08-05 12:49:28 +0200 |
commit | 6fb08f1a5f7e5cdde1ce00104788e602f4299b99 (patch) | |
tree | 6ef35115af5ac1e1f35728358782920a527f2410 | |
parent | 65f11c72780fa9d598df88def045ccb6a885cf80 (diff) |
HID: logitech-dj: Really fix return value of logi_dj_recv_query_hidpp_devices
Commit dbcbabf7da92 ("HID: logitech-dj: fix return value of
logi_dj_recv_query_hidpp_devices") made logi_dj_recv_query_hidpp_devices
return the return value of hid_hw_raw_request instead of unconditionally
returning 0.
But hid_hw_raw_request returns the report-size on a successful request
(and a negative error-code on failure) where as the callers of
logi_dj_recv_query_hidpp_devices expect a 0 return on success.
This commit fixes things so that either the negative error gets returned
or 0 on success, fixing HID++ receivers such as the Logitech nano receivers
no longer working.
Cc: YueHaibing <[email protected]>
Cc: Rafael J. Wysocki <[email protected]>
Cc: Lionel Landwerlin <[email protected]>
Fixes: dbcbabf7da92 ("HID: logitech-dj: fix return value of logi_dj_recv_query_hidpp_devices")
Reported-by: Lionel Landwerlin <[email protected]>
Reported-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Tested-by: Rafael J. Wysocki <[email protected]>
Reviewed-by: Petr Vorel <[email protected]>
Tested-by: Petr Vorel <[email protected]>
Reviewed-by: YueHaibing <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
-rw-r--r-- | drivers/hid/hid-logitech-dj.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c index d5b47ec1510c..cc47f948c1d0 100644 --- a/drivers/hid/hid-logitech-dj.c +++ b/drivers/hid/hid-logitech-dj.c @@ -1125,7 +1125,7 @@ static int logi_dj_recv_query_hidpp_devices(struct dj_receiver_dev *djrcv_dev) HID_REQ_SET_REPORT); kfree(hidpp_report); - return retval; + return (retval < 0) ? retval : 0; } static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev) |