Commit 1af738ad authored by Benjamin Tissoires's avatar Benjamin Tissoires Committed by Greg Kroah-Hartman

Revert "HID: Increase maximum report size allowed by hid_field_extract()"

commit 15fc1b5c upstream.

This reverts commit 94a9992f.

The commit allows for more than 32 bits in hid_field_extract(),
but the return value is a 32 bits int.
So basically what this commit is doing is just silencing those
legitimate errors.

Revert to a previous situation in the hope that a proper
fix will be impletemented.

Fixes: 94a9992f ("HID: Increase maximum report size allowed by hid_field_extract()")
Cc: stable@vger.kernel.org # v5.1
Acked-by: default avatarJiri Kosina <jkosina@suse.cz>
Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0e3b0666
...@@ -1313,10 +1313,10 @@ static u32 __extract(u8 *report, unsigned offset, int n) ...@@ -1313,10 +1313,10 @@ static u32 __extract(u8 *report, unsigned offset, int n)
u32 hid_field_extract(const struct hid_device *hid, u8 *report, u32 hid_field_extract(const struct hid_device *hid, u8 *report,
unsigned offset, unsigned n) unsigned offset, unsigned n)
{ {
if (n > 256) { if (n > 32) {
hid_warn(hid, "hid_field_extract() called with n (%d) > 256! (%s)\n", hid_warn(hid, "hid_field_extract() called with n (%d) > 32! (%s)\n",
n, current->comm); n, current->comm);
n = 256; n = 32;
} }
return __extract(report, offset, n); return __extract(report, offset, n);
......
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