aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>2012-07-14 18:59:25 -0300
committerKalimochoAz <calimochoazucarado@gmail.com>2012-08-30 21:45:55 +0200
commitca25ce6353bab9cc8a7c5a0ec0e76cc366ed3309 (patch)
tree74ed5d933c21cb0a8386b3eb9826044a1fd524fa
parente2967fc39347f2dcb2d3d7433ad367f17d265e75 (diff)
downloadkernel_samsung_crespo-ca25ce6353bab9cc8a7c5a0ec0e76cc366ed3309.tar.gz
kernel_samsung_crespo-ca25ce6353bab9cc8a7c5a0ec0e76cc366ed3309.tar.bz2
kernel_samsung_crespo-ca25ce6353bab9cc8a7c5a0ec0e76cc366ed3309.zip
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>
-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 119b7e6405b..714cd8cc957 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]);