Skip to content

Commit 34a9fa2

Browse files
pceballosgoogleJiri Kosina
authored andcommitted
HID: hid-sensor-hub: Fix issue with devices with no report ID
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>
1 parent 5c7e02a commit 34a9fa2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/hid/hid-sensor-hub.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,8 @@ static int sensor_hub_raw_event(struct hid_device *hdev,
483483
return 1;
484484

485485
ptr = raw_data;
486-
ptr++; /* Skip report id */
486+
if (report->id)
487+
ptr++; /* Skip report id */
487488

488489
spin_lock_irqsave(&pdata->lock, flags);
489490

0 commit comments

Comments
 (0)