diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index 511125a2d3b3..42142a25df45 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -1106,6 +1106,7 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data) ret = -ENOMEM; goto error_mutex; } + io_data->buf = data; if (!io_data->read && !copy_from_iter_full(data, data_len, &io_data->data)) { ret = -EFAULT; @@ -1151,8 +1152,6 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data) } req->length = data_len; - io_data->buf = data; - req->context = &done; req->complete = ffs_epfile_io_complete; @@ -1200,7 +1199,6 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data) } req->length = data_len; - io_data->buf = data; io_data->ep = ep->ep; io_data->req = req; io_data->ffs = epfile->ffs;