Commit 2d648d28 authored by Adam Kropelin's avatar Adam Kropelin Committed by Vojtech Pavlik

I have a buggy USB HID device (APC SmartUPS) in which the designers

forgot that ReportCount is a global item. Consequently, according to the
report descriptor, several reports have multiple copies of the same
usage in each field. When you actually query the device, however, only a
single copy of the usage is returned. hid-core catches the expected vs.
actual length mismatch and fails the transfer. This effectively makes
the buggy reports inaccessible even though enough data is present to
populate one usage (which is all userspace wants anyway).

This patch changes hid-core to only warn (if debug is enabled) on such
reports rather than failing the transfer.
Signed-off-by: default avatarAdam Kropelin <akropel1@rochester.rr.com>
Signed-off-by: default avatarVojtech Pavlik <vojtech@suse.cz>
parent 0d1c2424
......@@ -892,10 +892,8 @@ static int hid_input_report(int type, struct urb *urb, struct pt_regs *regs)
size = ((report->size - 1) >> 3) + 1;
if (len < size) {
if (len < size)
dbg("report %d is too short, (%d < %d)", report->id, len, size);
return -1;
}
if (hid->claimed & HID_CLAIMED_HIDDEV)
hiddev_report_event(hid, report);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment