Skip to content
Snippets Groups Projects
Commit adefb69b authored by Vinicius Costa Gomes's avatar Vinicius Costa Gomes Committed by Jiri Kosina
Browse files

HID: uhid: Fix sending events with invalid data


This was detected because events with invalid types were arriving
to userspace.

The code before this patch would only work for the first event in the
queue (when uhid->tail is 0).

Signed-off-by: default avatarVinicius Costa Gomes <vinicius.gomes@openbossa.org>
Reviewed-by: default avatarDavid Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 1a8b294c
No related branches found
No related tags found
No related merge requests found
......@@ -465,7 +465,7 @@ try_again:
goto try_again;
} else {
len = min(count, sizeof(**uhid->outq));
if (copy_to_user(buffer, &uhid->outq[uhid->tail], len)) {
if (copy_to_user(buffer, uhid->outq[uhid->tail], len)) {
ret = -EFAULT;
} else {
kfree(uhid->outq[uhid->tail]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment