USB: musb: be careful with 64K+ transfer lengths, host side
authorSergei Shtylyov <sshtylyov@ru.mvista.com>
Sat, 21 Feb 2009 23:31:23 +0000 (15:31 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 27 Feb 2009 22:40:51 +0000 (14:40 -0800)
commit3ecdb9acf343bbcf2bb2c287dc524ab709cfad7e
tree0e6bb1dada7b9793c7f95cff9498a3283fade244
parent51d9f3e100a8f8cc2be89d5f13d37de61e2da38a
USB: musb: be careful with 64K+ transfer lengths, host side

Feeding 32-bit length cast down to 'u16' to min() to calculate the FIFO
count in musb_host_tx() risks sending a short packet prematurely for
transfer sizes over 64 KB.

Similarly, although data transfer size shouldn't exceed 65535 bytes for
the control endpoint, making musb_h_ep0_continue() more robust WRT URBs
with possibly oversized buffer will not hurt either...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/musb/musb_host.c