> > + if (!hidg->in_ep->enabled) { > > + ERROR(hidg->func.config->cdev, "in_ep is disabled\n"); > > + status = -ESHUTDOWN; > > + goto release_write_pending; > > What prevents "enabled" from changing right after you test this? You do > not have the lock held so could it change then? Inside usb_ep_queue() a similar check is used without blocking. I suppose this is how it should be. Here it's necessary for the error message. > > + } > > + > > status = usb_ep_queue(hidg->in_ep, req, GFP_ATOMIC); > > - if (status < 0) { > > - ERROR(hidg->func.config->cdev, > > - "usb_ep_queue error on int endpoint %zd\n", status); > > + if (status < 0) > > goto release_write_pending; > > No error message if queueing up failed? Yes. For each write from userspace, this generates one message. This can lead to a huge spam in the log.