aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/uhid.c
diff options
context:
space:
mode:
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>2012-07-14 18:59:25 -0300
committerHumberto Borba <humberos@gmail.com>2013-01-12 21:06:12 -0200
commitd5d6ced8dd7aa5d1b54008d7fdb5419ab6c08a01 (patch)
tree31f09d2a73116809a1d10621a072227d1f03e692 /drivers/hid/uhid.c
parente7ff9a7695ef965bee653afb0063dfb8f768934a (diff)
downloadkernel_samsung_smdk4412-d5d6ced8dd7aa5d1b54008d7fdb5419ab6c08a01.zip
kernel_samsung_smdk4412-d5d6ced8dd7aa5d1b54008d7fdb5419ab6c08a01.tar.gz
kernel_samsung_smdk4412-d5d6ced8dd7aa5d1b54008d7fdb5419ab6c08a01.tar.bz2
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/uhid.c')
-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 119b7e6..714cd8c 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]);