Date: Tue, 24 Nov 2009 17:38:16 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 170990 for review Message-ID: <200911241738.nAOHcGcW021087@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/chv.cgi?CH=170990 Change 170990 by hselasky@hselasky_laptop001 on 2009/11/24 17:37:41 USB input: - HID improvement - fix issue reported by "Daichi GOTO" - patch by HPS Affected files ... .. //depot/projects/usb/src/sys/dev/usb/input/uhid.c#16 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/input/uhid.c#16 (text+ko) ==== @@ -173,12 +173,21 @@ DPRINTF("transferred!\n"); pc = usbd_xfer_get_frame(xfer, 0); - if (actlen >= sc->sc_isize) { + + /* + * If the ID byte is non zero we allow descriptors + * having multiple sizes: + */ + if ((actlen >= sc->sc_isize) || + ((actlen > 0) && (sc->sc_iid != 0))) { + /* limit report length to the maximum */ + if (actlen > sc->sc_isize) + actlen = sc->sc_isize; usb_fifo_put_data(sc->sc_fifo.fp[USB_FIFO_RX], pc, - 0, sc->sc_isize, 1); + 0, actlen, 1); } else { /* ignore it */ - DPRINTF("ignored short transfer, %d bytes\n", actlen); + DPRINTF("ignored transfer, %d bytes\n", actlen); } case USB_ST_SETUP:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911241738.nAOHcGcW021087>