Commit b6f61525 authored by Hans Petter Selasky's avatar Hans Petter Selasky
Browse files

uhid(4): Don't read-ahead from the USB IN endpoint.

This avoids an issue where IN endpoint data received from the device right
before the file handle is closed, gets lost.

PR:		263995
MFC after:	1 week
Sponsored by:	NVIDIA Networking
parent f5766992
......@@ -218,6 +218,12 @@ uhid_intr_read_callback(struct usb_xfer *xfer, usb_error_t error)
actlen = sc->sc_isize;
usb_fifo_put_data(sc->sc_fifo.fp[USB_FIFO_RX], pc,
0, actlen, 1);
/*
* Do not do read-ahead, because this may lead
* to data loss!
*/
return;
} else {
/* ignore it */
DPRINTF("ignored transfer, %d bytes\n", actlen);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment