summaryrefslogtreecommitdiff
path: root/sys/dev/usb/input
diff options
context:
space:
mode:
authorMatthew Nygard Dodd <Matthew.Nygard.Dodd@gmail.com>2024-11-18 04:15:01 +0000
committerVladimir Kondratyev <wulf@FreeBSD.org>2024-12-22 03:33:16 +0000
commit4bbc69192e4feea57198b5d00ec2b7e2f1b0579d (patch)
tree51e44a080f9eb2cfe5b3b790c4c8e7ded13e1ab5 /sys/dev/usb/input
parent0520d2ea9dd37fc968f02e615b53bfe4521af789 (diff)
Diffstat (limited to 'sys/dev/usb/input')
-rw-r--r--sys/dev/usb/input/uhid.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/usb/input/uhid.c b/sys/dev/usb/input/uhid.c
index 863e04f4e52b..098ec4364df7 100644
--- a/sys/dev/usb/input/uhid.c
+++ b/sys/dev/usb/input/uhid.c
@@ -633,11 +633,13 @@ uhid_ioctl(struct usb_fifo *fifo, u_long cmd, void *addr,
default:
return (EINVAL);
}
+ size = imin(ugd->ugd_maxlen, size);
if (id != 0)
error = copyin(ugd->ugd_data, &id, 1);
if (error == 0)
error = uhid_get_report(sc, ugd->ugd_report_type, id,
- NULL, ugd->ugd_data, imin(ugd->ugd_maxlen, size));
+ NULL, ugd->ugd_data, size);
+ ugd->ugd_actlen = size;
break;
case USB_SET_REPORT: