From: Li Jun Date: Thu, 3 Aug 2017 17:24:35 +0000 (+0800) Subject: MLK-16135 usb: gadget: utp: bulk out req amount divisible by 512 X-Git-Tag: C0P2-H0.0--20200415~1894 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=ae35a2416c7c0fd56182f463e298560f16599083;p=linux.git MLK-16135 usb: gadget: utp: bulk out req amount divisible by 512 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 Signed-off-by: Li Jun --- diff --git a/drivers/usb/gadget/function/fsl_updater.c b/drivers/usb/gadget/function/fsl_updater.c index ef6fb33340d9..f2729cf2b839 100644 --- a/drivers/usb/gadget/function/fsl_updater.c +++ b/drivers/usb/gadget/function/fsl_updater.c @@ -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);