projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a52ec10
)
HID: logitech-hidpp: return an error if the queried feature is not present
author
Benjamin Tissoires
<benjamin.tissoires@redhat.com>
Mon, 27 Mar 2017 14:59:32 +0000
(16:59 +0200)
committer
Jiri Kosina
<jkosina@suse.cz>
Thu, 6 Apr 2017 12:36:38 +0000
(14:36 +0200)
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>
drivers/hid/hid-logitech-hidpp.c
patch
|
blob
|
history
diff --git
a/drivers/hid/hid-logitech-hidpp.c
b/drivers/hid/hid-logitech-hidpp.c
index 9a9771a311087e85d9a8fdd512d7fcc1c9cbd7cc..22129ddac3aeaea8abfe3a34f8f99e2d4559fe98 100644
(file)
--- a/
drivers/hid/hid-logitech-hidpp.c
+++ b/
drivers/hid/hid-logitech-hidpp.c
@@
-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];