]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
HID: hid-sensor-hub: Fix issue with devices with no report ID
authorPablo Ceballos <pceballos@google.com>
Tue, 3 Nov 2020 00:29:39 +0000 (19:29 -0500)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 20 Jan 2021 13:24:36 +0000 (14:24 +0100)
BugLink: https://bugs.launchpad.net/bugs/1908562
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Ian May <ian.may@canonical.com>
drivers/hid/hid-sensor-hub.c

index 94c7398b5c279f21775f5b1b5e550e0d848818c6..3dd7d324673783dd710a68cf4b35cfb26f6a06bd 100644 (file)
@@ -483,7 +483,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);