MLK-16135 usb: gadget: utp: bulk out req amount divisible by 512
authorLi Jun <jun.li@nxp.com>
Thu, 3 Aug 2017 17:24:35 +0000 (01:24 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:36:22 +0000 (15:36 -0500)
As the code comments say, the bulk out req amount should be divisible
by 512, fix this by using set_bulk_out_req_length().

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
drivers/usb/gadget/function/fsl_updater.c

index ef6fb33..f2729cf 100644 (file)
@@ -309,8 +309,7 @@ static int utp_do_write(struct fsg_dev *fsg, void *data, size_t size)
 
                        /* amount is always divisible by 512, hence by
                         * the bulk-out maxpacket size */
-                       bh->outreq->length = bh->bulk_out_intended_length =
-                                       amount;
+                       set_bulk_out_req_length(fsg->common, bh, amount);
                        bh->outreq->short_not_ok = 1;
                        start_transfer(fsg, fsg->bulk_out, bh->outreq,
                                        &bh->outreq_busy, &bh->state);