Message ID | 200f38d3e3eb44ec8ec8f8e9f210f131@inspur.com |
---|---|
State | Superseded |
Headers | show |
Series | [v2] usb: musb: Fix musb_gadget.c rxstate may cause request->buf overflow problems | expand |
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 51274b87f46c..4ad5a1f31d7e 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -760,6 +760,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) musb_writew(epio, MUSB_RXCSR, csr); buffer_aint_mapped: + fifo_count = min_t(unsigned, request->length - request->actual, fifo_count); musb_read_fifo(musb_ep->hw_ep, fifo_count, (u8 *) (request->buf + request->actual)); request->actual += fifo_count;