From: Rui Miguel Silva Date: Mon, 18 May 2015 15:02:07 +0000 (+0100) Subject: usb: gadget: f_fs: do not set cancel function on synchronous {read,write} X-Git-Tag: v4.2-rc3~16^2~1^2~4 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4088acf1e845aba35f30fb91dee10649edbd0e84;p=karo-tx-linux.git 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: # v4.0+ Acked-by: Al Viro Signed-off-by: Rui Miguel Silva Signed-off-by: Felipe Balbi --- 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)