Author: hselasky
Date: Fri Jan 17 08:21:09 2014
New Revision: 260808
URL: http://svnweb.freebsd.org/changeset/base/260808

Log:
  Close a minor deadlock.
  
  MFC after:    1 week

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

Modified: head/sys/dev/usb/usb_dev.c
==============================================================================
--- head/sys/dev/usb/usb_dev.c  Fri Jan 17 06:43:35 2014        (r260807)
+++ head/sys/dev/usb/usb_dev.c  Fri Jan 17 08:21:09 2014        (r260808)
@@ -597,6 +597,13 @@ usb_fifo_free(struct usb_fifo *f)
                mtx_unlock(f->priv_mtx);
                mtx_lock(&usb_ref_lock);
 
+               /*
+                * Check if the "f->refcount" variable reached zero
+                * during the unlocked time before entering wait:
+                */
+               if (f->refcount == 0)
+                       break;
+
                /* wait for sync */
                cv_wait(&f->cv_drain, &usb_ref_lock);
        }
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to