git: fe4bdd889b5d - main - hidraw(4): Force switch to hidraw mode on HIDIOCGRDESC ioctl
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 27 Apr 2025 09:09:08 UTC
The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=fe4bdd889b5d722faa3a66e2c7d9a248e527cdb2 commit fe4bdd889b5d722faa3a66e2c7d9a248e527cdb2 Author: Vladimir Kondratyev <wulf@FreeBSD.org> AuthorDate: 2025-04-27 09:07:35 +0000 Commit: Vladimir Kondratyev <wulf@FreeBSD.org> CommitDate: 2025-04-27 09:07:35 +0000 hidraw(4): Force switch to hidraw mode on HIDIOCGRDESC ioctl To match documentation. Reported by: Ihor Dutchak <ihor.youw@gmail.com> PR: 286155 MFC after: 3 days --- sys/dev/hid/hidraw.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/hid/hidraw.c b/sys/dev/hid/hidraw.c index c9d29b836d43..9b6f83d34d08 100644 --- a/sys/dev/hid/hidraw.c +++ b/sys/dev/hid/hidraw.c @@ -829,6 +829,9 @@ hidraw_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, */ if (size >= HID_MAX_DESCRIPTOR_SIZE) return (EINVAL); + mtx_lock(&sc->sc_mtx); + sc->sc_state.uhid = false; + mtx_unlock(&sc->sc_mtx); buf = HIDRAW_LOCAL_ALLOC(local_buf, size); error = hid_get_rdesc(sc->sc_dev, buf, size); if (error == 0) {