diff options
author | Pablo Ceballos <pceballos@google.com> | 2020-11-03 03:29:39 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-12-02 10:31:26 +0300 |
commit | f75aa5607ff22ef78f026b72b04b535b52ec6413 (patch) | |
tree | f44a112902107d6bf45247808f5c33cadcabd786 | |
parent | afd30b9d90ff8f8596ec22aa0beffb6399e4abd8 (diff) | |
download | linux-f75aa5607ff22ef78f026b72b04b535b52ec6413.tar.xz |
HID: hid-sensor-hub: Fix issue with devices with no report ID
[ Upstream commit 34a9fa2025d9d3177c99351c7aaf256c5f50691f ]
Some HID devices don't use a report ID because they only have a single
report. In those cases, the report ID in struct hid_report will be zero
and the data for the report will start at the first byte, so don't skip
over the first byte.
Signed-off-by: Pablo Ceballos <pceballos@google.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/hid/hid-sensor-hub.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c index 4ef73374a8f9..7001f07ca399 100644 --- a/drivers/hid/hid-sensor-hub.c +++ b/drivers/hid/hid-sensor-hub.c @@ -489,7 +489,8 @@ static int sensor_hub_raw_event(struct hid_device *hdev, return 1; ptr = raw_data; - ptr++; /* Skip report id */ + if (report->id) + ptr++; /* Skip report id */ spin_lock_irqsave(&pdata->lock, flags); |