summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-picolcd_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-picolcd_core.c')
-rw-r--r--drivers/hid/hid-picolcd_core.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/hid/hid-picolcd_core.c b/drivers/hid/hid-picolcd_core.c
index acbb021065ec..020df3c2e8b4 100644
--- a/drivers/hid/hid-picolcd_core.c
+++ b/drivers/hid/hid-picolcd_core.c
@@ -350,6 +350,12 @@ static int picolcd_raw_event(struct hid_device *hdev,
if (!data)
return 1;
+ if (size > 64) {
+ hid_warn(hdev, "invalid size value (%d) for picolcd raw event\n",
+ size);
+ return 0;
+ }
+
if (report->id == REPORT_KEY_STATE) {
if (data->input_keys)
ret = picolcd_raw_keypad(data, report, raw_data+1, size-1);