]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
USB: g_printer: fix handling zero-length packet
authorSangSu Park <sangsu@gmail.com>
Mon, 22 Sep 2008 22:41:15 +0000 (15:41 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 17 Oct 2008 21:40:56 +0000 (14:40 -0700)
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>
drivers/usb/gadget/printer.c

index 2b3b9e1dd2ee2987c3ee1420802a7544af2597f9..00b7ed5013a6a70a57a9c504aa84e96f95b1a18c 100644 (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);