diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2019-06-05 08:44:05 -0400 |
---|---|---|
committer | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2019-06-05 09:14:53 -0400 |
commit | 15fc1b5c86128f91c8c6699c3b0d9615740b13f1 (patch) | |
tree | 174f6e72c44865a3c03973e881649c636e87f098 /drivers/hid | |
parent | abf82e8f7e9af40a49e3d905187c662a43c96c8f (diff) |
Revert "HID: Increase maximum report size allowed by hid_field_extract()"
This reverts commit 94a9992f7dbdfb28976b565af220e0c4a117144a.
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: 94a9992f7dbd ("HID: Increase maximum report size allowed by hid_field_extract()")
Cc: stable@vger.kernel.org # v5.1
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 92387fc0bf18..4407cf549908 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1314,10 +1314,10 @@ static u32 __extract(u8 *report, unsigned offset, int n) | |||
1314 | u32 hid_field_extract(const struct hid_device *hid, u8 *report, | 1314 | u32 hid_field_extract(const struct hid_device *hid, u8 *report, |
1315 | unsigned offset, unsigned n) | 1315 | unsigned offset, unsigned n) |
1316 | { | 1316 | { |
1317 | if (n > 256) { | 1317 | if (n > 32) { |
1318 | hid_warn(hid, "hid_field_extract() called with n (%d) > 256! (%s)\n", | 1318 | hid_warn(hid, "hid_field_extract() called with n (%d) > 32! (%s)\n", |
1319 | n, current->comm); | 1319 | n, current->comm); |
1320 | n = 256; | 1320 | n = 32; |
1321 | } | 1321 | } |
1322 | 1322 | ||
1323 | return __extract(report, offset, n); | 1323 | return __extract(report, offset, n); |