From 19451f9df775eb8c15f887f296bc694e5b5db12f Mon Sep 17 00:00:00 2001 From: Ogier Bouvier Date: Fri, 8 Sep 2017 15:19:38 +0200 Subject: [PATCH] hidpp20: fix last feature discovery Signed-off-by: Ogier Bouvier --- src/hidpp20.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hidpp20.c b/src/hidpp20.c index 72c9ec04..57fca364 100644 --- a/src/hidpp20.c +++ b/src/hidpp20.c @@ -341,7 +341,10 @@ hidpp20_feature_set_get(struct hidpp20_device *device) flist = zalloc(feature_count * sizeof(struct hidpp20_feature)); - for (i = 0; i < feature_count; i++) { + /* feature set count does not include the root feature as documented here: + * https://6xq.net/git/lars/lshidpp.git/plain/doc/logitech_hidpp_2.0_specification_draft_2012-06-04.pdf + **/ + for (i = 0; i <= feature_count; i++) { rc = hidpp20_feature_set_get_feature_id(device, feature_index, i,