summaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2020-01-27 15:49:30 +0100
committerJiri Kosina <jkosina@suse.cz>2020-01-27 15:49:30 +0100
commita09ac40e420d547f58a40608f05a3a3b3a538ce8 (patch)
treef1f71874f2224c083f2e9469148f53e27fd49a7f /drivers/hid
parentHID: hidraw, uhid: Always report EPOLLOUT (diff)
parentHID: hidraw: add support uniq ioctl (diff)
downloadlinux-a09ac40e420d547f58a40608f05a3a3b3a538ce8.tar.xz
linux-a09ac40e420d547f58a40608f05a3a3b3a538ce8.zip
Merge branch 'for-5.6/hidraw' into for-linus
- support for uniq ioctl()
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hidraw.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
index 7a75aff78388..2eee5e31c2b7 100644
--- a/drivers/hid/hidraw.c
+++ b/drivers/hid/hidraw.c
@@ -451,6 +451,15 @@ static long hidraw_ioctl(struct file *file, unsigned int cmd,
-EFAULT : len;
break;
}
+
+ if (_IOC_NR(cmd) == _IOC_NR(HIDIOCGRAWUNIQ(0))) {
+ int len = strlen(hid->uniq) + 1;
+ if (len > _IOC_SIZE(cmd))
+ len = _IOC_SIZE(cmd);
+ ret = copy_to_user(user_arg, hid->uniq, len) ?
+ -EFAULT : len;
+ break;
+ }
}
ret = -ENOTTY;