hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/usb/musb/musb_gadget.c
....@@ -760,6 +760,9 @@
760760 musb_writew(epio, MUSB_RXCSR, csr);
761761
762762 buffer_aint_mapped:
763
+ fifo_count = min_t(unsigned int,
764
+ request->length - request->actual,
765
+ (unsigned int)fifo_count);
763766 musb_read_fifo(musb_ep->hw_ep, fifo_count, (u8 *)
764767 (request->buf + request->actual));
765768 request->actual += fifo_count;
....@@ -1085,7 +1088,6 @@
10851088 u8 epnum;
10861089 struct musb_ep *musb_ep;
10871090 void __iomem *epio;
1088
- int status = 0;
10891091
10901092 musb_ep = to_musb_ep(ep);
10911093 musb = musb_ep->musb;
....@@ -1118,7 +1120,7 @@
11181120
11191121 musb_dbg(musb, "%s", musb_ep->end_point.name);
11201122
1121
- return status;
1123
+ return 0;
11221124 }
11231125
11241126 /*
....@@ -1318,7 +1320,7 @@
13181320 }
13191321
13201322 /*
1321
- * Set or clear the halt bit of an endpoint. A halted enpoint won't tx/rx any
1323
+ * Set or clear the halt bit of an endpoint. A halted endpoint won't tx/rx any
13221324 * data but will queue requests.
13231325 *
13241326 * exported to ep0 code