Loading drivers/usb/gadget/function/f_fs.c +12 −2 Original line number Diff line number Diff line Loading @@ -711,6 +711,7 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data) { struct ffs_epfile *epfile = file->private_data; struct ffs_ep *ep; struct ffs_data *ffs = epfile->ffs; char *data = NULL; ssize_t ret, data_len = -EINVAL; int halt; Loading @@ -721,7 +722,6 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data) io_data->read); retry: first_read = false; if (atomic_read(&epfile->error)) return -ENODEV; Loading Loading @@ -949,15 +949,25 @@ retry: ret = ep->status; else ret = -ENODEV; /* do wait again if func eps are not enabled */ if (io_data->read && first_read && (ret < 0)) { unsigned short count = ffs->eps_count; pr_debug("%s: waiting for the online state\n", __func__); ret = 0; kfree(data); data = NULL; data_len = -EINVAL; spin_unlock_irq(&epfile->ffs->eps_lock); mutex_unlock(&epfile->mutex); epfile = ffs->epfiles; do { atomic_set(&epfile->error, 0); ++epfile; } while (--count); epfile = file->private_data; first_read = false; goto retry; } Loading Loading
drivers/usb/gadget/function/f_fs.c +12 −2 Original line number Diff line number Diff line Loading @@ -711,6 +711,7 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data) { struct ffs_epfile *epfile = file->private_data; struct ffs_ep *ep; struct ffs_data *ffs = epfile->ffs; char *data = NULL; ssize_t ret, data_len = -EINVAL; int halt; Loading @@ -721,7 +722,6 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data) io_data->read); retry: first_read = false; if (atomic_read(&epfile->error)) return -ENODEV; Loading Loading @@ -949,15 +949,25 @@ retry: ret = ep->status; else ret = -ENODEV; /* do wait again if func eps are not enabled */ if (io_data->read && first_read && (ret < 0)) { unsigned short count = ffs->eps_count; pr_debug("%s: waiting for the online state\n", __func__); ret = 0; kfree(data); data = NULL; data_len = -EINVAL; spin_unlock_irq(&epfile->ffs->eps_lock); mutex_unlock(&epfile->mutex); epfile = ffs->epfiles; do { atomic_set(&epfile->error, 0); ++epfile; } while (--count); epfile = file->private_data; first_read = false; goto retry; } Loading