* they're ordered meaningfully in this array
*/
if (iface->altsetting [i].desc.bAlternateSetting != i) {
- dbg ("%s, illegal alt [%d].bAltSetting = %d",
+ dbg ("%s, invalid alt [%d].bAltSetting = %d",
dev->id, i,
iface->altsetting [i].desc
.bAlternateSetting);
*/
/* unlink whatever's still pending */
- for (i = 0; i < ctx->param->sglen; i++) {
- struct urb *u = ctx->urb [i];
+ for (i = 1; i < ctx->param->sglen; i++) {
+ struct urb *u = ctx->urb [
+ (i + subcase->number) % ctx->param->sglen];
if (u == urb || !u->dev)
continue;
/* FIXME set timer and time out; provide a disconnect hook */
/* wait for the last one to complete */
- wait_for_completion (&context.complete);
+ if (context.pending > 0)
+ wait_for_completion (&context.complete);
cleanup:
for (i = 0; i < param->sglen; i++) {
usb_set_intfdata (intf, NULL);
info ("unbound %s", dev->id);
+ kfree (dev);
}
/* Basic testing only needs a device that can source or sink bulk traffic.