Skip to content
Commit 456be345 authored by Hans de Goede's avatar Hans de Goede Committed by Paul Gortmaker
Browse files

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

commit 6fb08f1a upstream.

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>
Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
parent d73753b0
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