mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
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: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Reviewed-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
f1bc7101c0
commit
a2ba6804d3
1 changed files with 1 additions and 1 deletions
|
@ -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]);
|
||||
|
|
Loading…
Reference in a new issue