Author: thompsa
Date: Wed May 13 17:58:37 2009
New Revision: 192051
URL: http://svn.freebsd.org/changeset/base/192051

Log:
  The transfer must return USB_ERR_CANCELLED when the device is gone due to the
  way usb drivers work.
  
  Submitted by: Hans Petter Selasky

Modified:
  head/sys/dev/usb/usb_transfer.c

Modified: head/sys/dev/usb/usb_transfer.c
==============================================================================
--- head/sys/dev/usb/usb_transfer.c     Wed May 13 17:53:04 2009        
(r192050)
+++ head/sys/dev/usb/usb_transfer.c     Wed May 13 17:58:37 2009        
(r192051)
@@ -1439,7 +1439,11 @@ usb2_start_hardware(struct usb2_xfer *xf
        /* Check if the device is still alive */
        if (info->udev->state < USB_STATE_POWERED) {
                USB_BUS_LOCK(bus);
-               usb2_transfer_done(xfer, USB_ERR_NOT_CONFIGURED);
+               /*
+                * Must return cancelled error code else
+                * device drivers can hang.
+                */
+               usb2_transfer_done(xfer, USB_ERR_CANCELLED);
                USB_BUS_UNLOCK(bus);
                return;
        }
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to