mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-16 07:24:39 +08:00
HID: logitech-hidpp: return an error if the queried feature is not present
Or the device just answers a valid feature '0'. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Tested-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
a52ec107fa
commit
a9525b80fe
@ -503,6 +503,9 @@ static int hidpp_root_get_feature(struct hidpp_device *hidpp, u16 feature,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (response.fap.params[0] == 0)
|
||||
return -ENOENT;
|
||||
|
||||
*feature_index = response.fap.params[0];
|
||||
*feature_type = response.fap.params[1];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user