HID: uhid: Over-ride the default maximum data buffer value with our own
authorLee Jones <lee@kernel.org>
Mon, 23 Jan 2023 12:39:12 +0000 (12:39 +0000)
committerJiri Kosina <jkosina@suse.cz>
Thu, 23 Feb 2023 10:52:05 +0000 (11:52 +0100)
The default maximum data buffer size for this interface is UHID_DATA_MAX
(4k).  When data buffers are being processed, ensure this value is used
when ensuring the sanity, rather than a value between the user provided
value and HID_MAX_BUFFER_SIZE (16k).

Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/uhid.c

index f161c95..4588d2c 100644 (file)
@@ -395,6 +395,7 @@ static const struct hid_ll_driver uhid_hid_driver = {
        .parse = uhid_hid_parse,
        .raw_request = uhid_hid_raw_request,
        .output_report = uhid_hid_output_report,
+       .max_buffer_size = UHID_DATA_MAX,
 };
 
 #ifdef CONFIG_COMPAT