mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
USB: musb: be careful with 64K+ transfer lengths (gadget side)
request->actual is an unsigned and we should use the same variable type for fifo_count otherwise we might lose some data if request->length >= 64kbytes. [ dbrownell@users.sourceforge.net: fix compiler warning ] Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
34f32c9701
commit
c2c963217b
1 changed files with 2 additions and 2 deletions
|
@ -575,7 +575,7 @@ static void rxstate(struct musb *musb, struct musb_request *req)
|
||||||
struct usb_request *request = &req->request;
|
struct usb_request *request = &req->request;
|
||||||
struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out;
|
struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out;
|
||||||
void __iomem *epio = musb->endpoints[epnum].regs;
|
void __iomem *epio = musb->endpoints[epnum].regs;
|
||||||
u16 fifo_count = 0;
|
unsigned fifo_count = 0;
|
||||||
u16 len = musb_ep->packet_sz;
|
u16 len = musb_ep->packet_sz;
|
||||||
|
|
||||||
csr = musb_readw(epio, MUSB_RXCSR);
|
csr = musb_readw(epio, MUSB_RXCSR);
|
||||||
|
@ -687,7 +687,7 @@ static void rxstate(struct musb *musb, struct musb_request *req)
|
||||||
len, fifo_count,
|
len, fifo_count,
|
||||||
musb_ep->packet_sz);
|
musb_ep->packet_sz);
|
||||||
|
|
||||||
fifo_count = min(len, fifo_count);
|
fifo_count = min_t(unsigned, len, fifo_count);
|
||||||
|
|
||||||
#ifdef CONFIG_USB_TUSB_OMAP_DMA
|
#ifdef CONFIG_USB_TUSB_OMAP_DMA
|
||||||
if (tusb_dma_omap() && musb_ep->dma) {
|
if (tusb_dma_omap() && musb_ep->dma) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue