mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Close a minor deadlock.
MFC after: 1 week
This commit is contained in:
parent
0cfea1c8fc
commit
c7d8c1c6e0
1 changed files with 7 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue