HID: hid-sensor-hub: Fix issue with devices with no report ID

[ Upstream commit 34a9fa2025 ]

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>
This commit is contained in:
Pablo Ceballos 2020-11-02 19:29:39 -05:00 committed by Greg Kroah-Hartman
parent 8f68a28c9e
commit b3701c29a4
1 changed files with 2 additions and 1 deletions

View File

@ -483,6 +483,7 @@ static int sensor_hub_raw_event(struct hid_device *hdev,
return 1;
ptr = raw_data;
if (report->id)
ptr++; /* Skip report id */
spin_lock_irqsave(&pdata->lock, flags);