}
#endif
- if(atomic_read(&urb->use_count)>1){
+ if (unlikely(atomic_read(&urb->use_count) > 1)) {
retval = -EPERM;
- printk("%s urb %p already in queue, qtd %p, count%d\n",
+ printk("%s urb %p already in queue, qtd %p, use_count %d\n",
__func__, urb, urb->hcpriv, atomic_read(&urb->use_count));
- return retval;
+ return retval;
+ }
+
+ if (unlikely(atomic_read(&urb->reject))) {
+ retval = -EPERM;
+ printk("%s urb %p submissions will fail, urb->reject %d, use_count %d\n",
+ __func__, urb, atomic_read(&urb->reject), atomic_read(&urb->use_count));
+ return retval;
+
}
if ((usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS)