aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Kondratyev <wulf@FreeBSD.org>2021-02-13 18:19:02 +0000
committerVladimir Kondratyev <wulf@FreeBSD.org>2021-02-23 23:41:49 +0000
commit9262a9ce06a697c7459a03d559b980673fd9c934 (patch)
treec4b481c3dc0d093d217f51ff188c8139504cf05a
parentea10694336b9a07d58d22187052291976f4906b2 (diff)
downloadsrc-9262a9ce06a697c7459a03d559b980673fd9c934.tar.gz
src-9262a9ce06a697c7459a03d559b980673fd9c934.zip
hidraw: Make HIDIOCGRDESCSIZE ioctl return report descriptor size
defined by hardware rather than cached one to match HIDIOCGRDESC ioctl. This fixes errors reported by hid-tools being run against /dev/hidraw# device node belonging to driver which overloads report descriptor. MFC after: 1 week (cherry picked from commit f988d7fa050e4886cdeb9483a039e75d58c31883)
-rw-r--r--sys/dev/hid/hidraw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/hid/hidraw.c b/sys/dev/hid/hidraw.c
index 6cc67ff14d23..e71b2e2c7d5d 100644
--- a/sys/dev/hid/hidraw.c
+++ b/sys/dev/hid/hidraw.c
@@ -703,7 +703,7 @@ hidraw_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag,
return (0);
case HIDIOCGRDESCSIZE:
- *(int *)addr = sc->sc_rdesc->len;
+ *(int *)addr = sc->sc_hw->rdescsize;
return (0);
case HIDIOCGRDESC: