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 f988d7fa05)
This commit is contained in:
Vladimir Kondratyev 2021-02-13 21:19:02 +03:00
parent ea10694336
commit 9262a9ce06

View file

@ -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: