summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Laurendeau <mat.lau@laposte.net>2016-07-15 14:58:41 +0200
committerFelipe Balbi <felipe.balbi@linux.intel.com>2016-08-11 14:09:47 +0200
commit327b21da884fe1a29f733e41792ddd53e4a30379 (patch)
tree6b0881ed1980d8405534dfedc5f0858211945fb0
parentusb: gadget: composite: Fix return value in case of error (diff)
downloadlinux-327b21da884fe1a29f733e41792ddd53e4a30379.tar.xz
linux-327b21da884fe1a29f733e41792ddd53e4a30379.zip
usb/gadget: fix gadgetfs aio support.
Fix io submissions failing with ENODEV. Signed-off-by: Mathieu Laurendeau <mat.lau@laposte.net> Fixes: 7fe3976e0f3a ("gadget: switch ep_io_operations to ->read_iter/->write_iter") Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-rw-r--r--drivers/usb/gadget/legacy/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
index 8560f2fe3af5..16104b5ebdcb 100644
--- a/drivers/usb/gadget/legacy/inode.c
+++ b/drivers/usb/gadget/legacy/inode.c
@@ -542,7 +542,7 @@ static ssize_t ep_aio(struct kiocb *iocb,
*/
spin_lock_irq(&epdata->dev->lock);
value = -ENODEV;
- if (unlikely(epdata->ep))
+ if (unlikely(epdata->ep == NULL))
goto fail;
req = usb_ep_alloc_request(epdata->ep, GFP_ATOMIC);