Greg:

I sent this patch in (and David Brownell approved it) during the time you 
were busy with OLS.  It fixes a few minor problems in the usbtest driver:

        Unlinks are done in the expected order, preventing some 
inappropriate error messages.

        The driver would wait for an URB to complete, even if the URB 
got an error on submission.

        There was a surprising memory leak: the driver didn't kfree() its 
private data structure.

Please apply.

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 sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to