Commit 00e9d696 authored by Felipe Balbi's avatar Felipe Balbi Committed by Marek Vasut

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: default avatarFelipe Balbi <>
Signed-off-by: default avatarAndy Shevchenko <>
parent d4287766
......@@ -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;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment