Alan Stern wrote:

This patch for usbtest fixes three problems with test 10. (I didn't look at any of the other tests.)

This looks fine to me, suitable for Greg to merge. The first two wouldn't show up except after some existing error, which likely explains why I never noticed those problems. The slow leak is good to fix, but would usually not be harmful.

- Dave


Misleading error messages are eliminated by unlinking URBs in the expected sequence (i.e., starting with the one after the most recently terminated URB).

If there's an error in submission of the first test URB, don't wait for any URBs to complete. That happened in some of my tests, and of course the driver just hung.

Free the usbtest_dev structure! This was a rather surprising memory leak.

Alan Stern


===== usbtest.c 1.30 vs edited =====
--- 1.30/drivers/usb/misc/usbtest.c Mon Jul 14 16:35:15 2003
+++ edited/drivers/usb/misc/usbtest.c Mon Jul 21 09:34:02 2003
@@ -695,8 +695,9 @@
*/
/* 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;
@@ -893,7 +894,8 @@
/* 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++) {
@@ -1374,6 +1376,7 @@
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.







-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to