Message ID | 4DB92D93.7090602@st.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 966922f26c7fb5eddbe3c506b66bb5659f57b76f |
Headers | show |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index b144b38..c5efca3 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1024,6 +1024,9 @@ void hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, rsize = ((report->size - 1) >> 3) + 1; + if (rsize > HID_MAX_BUFFER_SIZE) + rsize = HID_MAX_BUFFER_SIZE; + if (csize < rsize) { dbg_hid("report %d is too short, (%d < %d)\n", report->id, csize, rsize);