Commit 6fb08f1a authored by Hans de Goede's avatar Hans de Goede Committed by Jiri Kosina

HID: logitech-dj: Really fix return value of logi_dj_recv_query_hidpp_devices

Commit dbcbabf7 ("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 <yuehaibing@huawei.com>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: dbcbabf7 ("HID: logitech-dj: fix return value of logi_dj_recv_query_hidpp_devices")
Reported-by: default avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
Reported-by: default avatarRafael J. Wysocki <rjw@rjwysocki.net>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Tested-by: default avatarRafael J. Wysocki <rjw@rjwysocki.net>
Reviewed-by: default avatarPetr Vorel <pvorel@suse.cz>
Tested-by: default avatarPetr Vorel <pvorel@suse.cz>
Reviewed-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 65f11c72
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment