Commit 6df6a80d authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] USB: usb_unlink_urb() has distinct "not linked" fault

This gets rid of an often-bogus diagnostic, and lets
at least the unlink test code recover reasonably when
it hits that brief window while another CPU has gotten
the complete() callback but hasn't yet resubmitted.



Return distinct code when unlinking an urb that's not linked.

This lets drivers handle this fault sanely, when they need to.
Gets rid of annoying non-error messages about drivers that unlink
in disconnect() even when the urb isn't linked.
parent 2328fb17
......@@ -1213,7 +1213,7 @@ static int hcd_unlink_urb (struct urb *urb)
break;
}
if (tmp != &urb->urb_list) {
retval = -EINVAL;
retval = -EIDRM;
goto done;
}
......@@ -1294,7 +1294,7 @@ static int hcd_unlink_urb (struct urb *urb)
spin_unlock (&hcd_data_lock);
spin_unlock_irqrestore (&urb->lock, flags);
bye:
if (retval && sys && sys->driver)
if (retval != -EIDRM && sys && sys->driver)
dev_dbg (sys, "hcd_unlink_urb %p fail %d\n", urb, retval);
return retval;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment