* [PATCH] HID: multitouch: handle empty feature report response in mt_get_feature()
@ 2026-12-06 10:03 Matti Paksula
0 siblings, 0 replies; only message in thread
From: Matti Paksula @ 2026-12-06 10:03 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires; +Cc: linux-input, linux-kernel
When a transport returns 0 bytes for a GET_REPORT feature request (for
example, i2c_hid_get_report() returns 0 on an empty response where
ret_count <= sizeof(__le16)), hid_hw_raw_request() succeeds without
writing any bytes into the zero-initialized buffer allocated by
hid_alloc_report_buf().
mt_get_feature() only checked for ret < 0, so ret == 0 fell through into
the report ID validation check and compared report->id against the
unwritten buf[0] (0), producing a spurious error:
hid-multitouch 0018:2C2F:0035.0002: Returned feature report did not match the request
This reproduces on every boot on a Lenovo ThinkPad X1 Carbon Gen 14 with
a Sensel haptic touchpad (SNSL0035:00, 2C2F:0035), where fetching the
Win8 certification blob (feature report ID 7, usage 0xff0000c5) returns
0 bytes. For an unnumbered report (report->id == 0), falling through on
ret == 0 would also feed an unwritten zeroed buffer to
hid_report_raw_event().
Skip the report ID check and raw event dispatch when ret == 0.
Link: https://lore.kernel.org/r/CABE=HBmmH_88d7CVhehXUV-DCCNM=Fepqw_s7i67xtA_AVFm8w@mail.gmail.com
Fixes: e716edafedad ("HID: multitouch: Check to ensure report responses match the request")
Cc: stable@vger.kernel.org
Signed-off-by: Matti Paksula <matti.paksula@gmail.com>
---
drivers/hid/hid-multitouch.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index f63d6f655..a2af2dc2d 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -540,6 +540,8 @@ static void mt_get_feature(struct hid_device *hdev, struct hid_report *report)
if (ret < 0) {
dev_warn(&hdev->dev, "failed to fetch feature %d\n",
report->id);
+ } else if (ret == 0) {
+ hid_dbg(hdev, "empty feature report %d\n", report->id);
} else {
/*
* The report ID in the request and the response should match.
--
2.56.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-12-06 10:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-06 10:03 [PATCH] HID: multitouch: handle empty feature report response in mt_get_feature() Matti Paksula
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®