diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2016-11-24 06:13:31 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-11-24 06:13:30 -0800 |
| commit | e49d49a3eca197a61351ebec9dddd7811d8d452e (patch) | |
| tree | e3f5316d30c7a9fb8c5179f128844e60f277e7da /drivers | |
| parent | e9ccaa5b6668c19f9b46917bb9b2d9fb13c58941 (diff) | |
| parent | beafbd43d59433b8ed5f4fb330a826239ff46f18 (diff) | |
Merge "USB: gagget: f_fs: Return error if TX req is queued during device offline"
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/usb/gadget/function/f_fs.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index eb2409dda50d..19d6a997ee6c 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -760,8 +760,8 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data) ssize_t ret, data_len = -EINVAL; int halt; - ffs_log("enter: epfile name %s epfile err %d", epfile->name, - atomic_read(&epfile->error)); + ffs_log("enter: epfile name %s epfile err %d (%s)", epfile->name, + atomic_read(&epfile->error), io_data->read ? "READ" : "WRITE"); smp_mb__before_atomic(); if (atomic_read(&epfile->error)) @@ -781,6 +781,12 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data) goto error; } + /* Don't wait on write if device is offline */ + if (!io_data->read) { + ret = -EINTR; + goto error; + } + /* * If ep is disabled, this fails all current IOs * and wait for next epfile open to happen. |
