Thread (23 messages) 23 messages, 3 authors, 2017-03-16
STALE3366d
Revisions (2)
  1. v2 current
  2. v3 [diff vs current]

[PATCH v2 07/15] HID: logitech-hidpp: return an error if the feature is not present

From: Benjamin Tissoires <hidden>
Date: 2017-02-02 14:15:48
Also in: lkml
Subsystem: hid core layer, hid logitech drivers, hid++ logitech drivers, the rest · Maintainers: Jiri Kosina, Benjamin Tissoires, Linus Torvalds

Or the device just answers a valid feature '0'.

Signed-off-by: Benjamin Tissoires <redacted>

---

no changes in v2
---
 drivers/hid/hid-logitech-hidpp.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index ef7ef9e..f7b2589 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -452,6 +452,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];
 
-- 
2.9.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help