linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Pablo Ceballos <pceballos@google.com>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	Jiri Kosina <jkosina@suse.cz>, Sasha Levin <sashal@kernel.org>,
	linux-input@vger.kernel.org, linux-iio@vger.kernel.org
Subject: [PATCH AUTOSEL 4.14 03/12] HID: hid-sensor-hub: Fix issue with devices with no report ID
Date: Wed, 25 Nov 2020 10:37:25 -0500	[thread overview]
Message-ID: <20201125153734.810826-3-sashal@kernel.org> (raw)
In-Reply-To: <20201125153734.810826-1-sashal@kernel.org>

From: Pablo Ceballos <pceballos@google.com>

[ 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>
---
 drivers/hid/hid-sensor-hub.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
index b5bd5cb7d5324..aa078c1dad14f 100644
--- a/drivers/hid/hid-sensor-hub.c
+++ b/drivers/hid/hid-sensor-hub.c
@@ -496,7 +496,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);
 
-- 
2.27.0


  parent reply	other threads:[~2020-11-25 15:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25 15:37 [PATCH AUTOSEL 4.14 01/12] HID: cypress: Support Varmilo Keyboards' media hotkeys Sasha Levin
2020-11-25 15:37 ` [PATCH AUTOSEL 4.14 02/12] Input: i8042 - allow insmod to succeed on devices without an i8042 controller Sasha Levin
2020-11-25 15:37 ` Sasha Levin [this message]
2020-11-25 15:37 ` [PATCH AUTOSEL 4.14 04/12] dmaengine: xilinx_dma: use readl_poll_timeout_atomic variant Sasha Levin
2020-11-25 15:37 ` [PATCH AUTOSEL 4.14 05/12] x86/xen: don't unbind uninitialized lock_kicker_irq Sasha Levin
2020-11-25 15:37 ` [PATCH AUTOSEL 4.14 06/12] HID: Add Logitech Dinovo Edge battery quirk Sasha Levin
2020-11-25 15:37 ` [PATCH AUTOSEL 4.14 07/12] proc: don't allow async path resolution of /proc/self components Sasha Levin
2020-11-25 15:37 ` [PATCH AUTOSEL 4.14 08/12] nvme: free sq/cq dbbuf pointers when dbbuf set fails Sasha Levin
2020-11-25 15:37 ` [PATCH AUTOSEL 4.14 09/12] dmaengine: pl330: _prep_dma_memcpy: Fix wrong burst size Sasha Levin
2020-11-25 15:37 ` [PATCH AUTOSEL 4.14 10/12] scsi: libiscsi: Fix NOP race condition Sasha Levin
2020-11-25 15:37 ` [PATCH AUTOSEL 4.14 11/12] scsi: target: iscsi: Fix cmd abort fabric stop race Sasha Levin
2020-11-25 15:37 ` [PATCH AUTOSEL 4.14 12/12] perf/x86: fix sysfs type mismatches Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201125153734.810826-3-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=jkosina@suse.cz \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pceballos@google.com \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).