USB: g_printer: fix handling zero-length packet

g_printer doesn't have to check whether the data size is a multiple of
MaxPacketSize, because device controller driver already make that check.

Signed-off-by: SangSu Park<sangsu@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <david-b@pacbell.net>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
SangSu Park 2008-09-22 15:41:15 -07:00 committed by Greg Kroah-Hartman
parent 0b14c3881d
commit 8296345a35
1 changed files with 1 additions and 2 deletions

View File

@ -1278,8 +1278,7 @@ unknown:
/* respond with data transfer before status phase? */
if (value >= 0) {
req->length = value;
req->zero = value < wLength
&& (value % gadget->ep0->maxpacket) == 0;
req->zero = value < wLength;
value = usb_ep_queue(gadget->ep0, req, GFP_ATOMIC);
if (value < 0) {
DBG(dev, "ep_queue --> %d\n", value);