diff options
author | Rui Miguel Silva <rui.silva@linaro.org> | 2015-05-18 17:02:07 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-07-06 19:34:08 +0200 |
commit | 4088acf1e845aba35f30fb91dee10649edbd0e84 (patch) | |
tree | 08865a7c25ee6e9923f2a9544f50cb654ba6e127 /drivers/usb | |
parent | usb: f_mass_storage: limit number of reported LUNs (diff) | |
download | linux-4088acf1e845aba35f30fb91dee10649edbd0e84.tar.xz linux-4088acf1e845aba35f30fb91dee10649edbd0e84.zip |
usb: gadget: f_fs: do not set cancel function on synchronous {read,write}
do not try to set cancel function in synchronous operations in
ffs_epfile_{read,write}_iter.
Cc: <stable@vger.kernel.org> # v4.0+
Acked-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/function/f_fs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index 45b8c8b338df..6e7be91e6097 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -924,7 +924,8 @@ static ssize_t ffs_epfile_write_iter(struct kiocb *kiocb, struct iov_iter *from) kiocb->private = p; - kiocb_set_cancel_fn(kiocb, ffs_aio_cancel); + if (p->aio) + kiocb_set_cancel_fn(kiocb, ffs_aio_cancel); res = ffs_epfile_io(kiocb->ki_filp, p); if (res == -EIOCBQUEUED) @@ -968,7 +969,8 @@ static ssize_t ffs_epfile_read_iter(struct kiocb *kiocb, struct iov_iter *to) kiocb->private = p; - kiocb_set_cancel_fn(kiocb, ffs_aio_cancel); + if (p->aio) + kiocb_set_cancel_fn(kiocb, ffs_aio_cancel); res = ffs_epfile_io(kiocb->ki_filp, p); if (res == -EIOCBQUEUED) |