From: SangSu Park Date: Mon, 22 Sep 2008 22:41:15 +0000 (-0700) Subject: USB: g_printer: fix handling zero-length packet X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8296345a35551414b07419f4c9223734c1fc5437;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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 Cc: Alan Stern Cc: David Brownell Cc: Greg KH Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c index 2b3b9e1dd2ee..00b7ed5013a6 100644 --- a/drivers/usb/gadget/printer.c +++ b/drivers/usb/gadget/printer.c @@ -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);