* still busy.
*/
if (!(io_data->read && ep->is_busy)) {
- ret = usb_ep_queue(ep->ep, req, GFP_ATOMIC);
ep->is_busy = true;
+ ret = usb_ep_queue(ep->ep, req, GFP_ATOMIC);
}
spin_unlock_irq(&epfile->ffs->eps_lock);
if (unlikely(ret < 0)) {
+ ep->is_busy = false;
ret = -EIO;
} else if (unlikely(
wait_for_completion_interruptible(done))) {
ffs_log("enter");
if (!is_sync_kiocb(kiocb)) {
- p = kmalloc(sizeof(io_data), GFP_KERNEL);
+ p = kzalloc(sizeof(io_data), GFP_KERNEL);
if (unlikely(!p))
return -ENOMEM;
p->aio = true;
} else {
+ memset(p, 0, sizeof(*p));
p->aio = false;
}
ffs_log("enter");
if (!is_sync_kiocb(kiocb)) {
- p = kmalloc(sizeof(io_data), GFP_KERNEL);
+ p = kzalloc(sizeof(io_data), GFP_KERNEL);
if (unlikely(!p))
return -ENOMEM;
p->aio = true;
} else {
+ memset(p, 0, sizeof(*p));
p->aio = false;
}
ffs_log("exit");
- return USB_GADGET_DELAYED_STATUS;
+ return creq->wLength == 0 ? USB_GADGET_DELAYED_STATUS : 0;
}
static void ffs_func_suspend(struct usb_function *f)