mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-25 22:20:45 +00:00
usb: gadget: f_dfu: write req->actual bytes
If last packet is short, we shouldn't write req->length bytes to non-volatile media, we should write only what's available to us, which is held in req->actual. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
This commit is contained in:
parent
d428776657
commit
00e9d69629
1 changed files with 1 additions and 1 deletions
|
@ -159,7 +159,7 @@ static void dnload_request_complete(struct usb_ep *ep, struct usb_request *req)
|
|||
int ret;
|
||||
|
||||
ret = dfu_write(dfu_get_entity(f_dfu->altsetting), req->buf,
|
||||
req->length, f_dfu->blk_seq_num);
|
||||
req->actual, f_dfu->blk_seq_num);
|
||||
if (ret) {
|
||||
f_dfu->dfu_status = DFU_STATUS_errUNKNOWN;
|
||||
f_dfu->dfu_state = DFU_STATE_dfuERROR;
|
||||
|
|
Loading…
Reference in a new issue