Skip to content

Commit fe4bdd8

Browse files
committed
hidraw(4): Force switch to hidraw mode on HIDIOCGRDESC ioctl
To match documentation. Reported by: Ihor Dutchak <[email protected]> PR: 286155 MFC after: 3 days
1 parent 8d4d08d commit fe4bdd8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sys/dev/hid/hidraw.c

+3
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,9 @@ hidraw_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag,
829829
*/
830830
if (size >= HID_MAX_DESCRIPTOR_SIZE)
831831
return (EINVAL);
832+
mtx_lock(&sc->sc_mtx);
833+
sc->sc_state.uhid = false;
834+
mtx_unlock(&sc->sc_mtx);
832835
buf = HIDRAW_LOCAL_ALLOC(local_buf, size);
833836
error = hid_get_rdesc(sc->sc_dev, buf, size);
834837
if (error == 0) {

0 commit comments

Comments
 (0)