Skip to content

Commit

Permalink
HID: hid-sensor-hub: Fix issue with devices with no report ID
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pablo Ceballos authored and Jiri Kosina committed Nov 5, 2020
1 parent 5c7e02a commit 34a9fa2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/hid/hid-sensor-hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 34a9fa2

Please sign in to comment.