aboutsummaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorVinicius Costa Gomes2012-07-14 18:59:25 -0300
committerJiri Kosina2012-07-20 09:53:45 +0200
commitadefb69b1b94df29ea2df05cd838c0e032b2c473 (patch)
treefee338077704e19810075750bb1b2c5577c358c9 /drivers/hid
parent1a8b294ce6b0cdab438175eed45ebb088bdd659a (diff)
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>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/uhid.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c
index 119b7e6405be..714cd8cc9579 100644
--- a/drivers/hid/uhid.c
+++ b/drivers/hid/uhid.c
@@ -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]);