diff options
Diffstat (limited to 'sys/dev/usb/usb_dev.c')
-rw-r--r-- | sys/dev/usb/usb_dev.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/usb/usb_dev.c b/sys/dev/usb/usb_dev.c index 7231230..2973fa4 100644 --- a/sys/dev/usb/usb_dev.c +++ b/sys/dev/usb/usb_dev.c @@ -229,7 +229,7 @@ usb_ref_device(struct usb_cdev_privdata *cpd, * We need to grab the enumeration SX-lock before * grabbing the FIFO refs to avoid deadlock at detach! */ - crd->do_unlock = usbd_enum_lock(cpd->udev); + crd->do_unlock = usbd_enum_lock_sig(cpd->udev); mtx_lock(&usb_ref_lock); @@ -237,6 +237,12 @@ usb_ref_device(struct usb_cdev_privdata *cpd, * Set "is_uref" after grabbing the default SX lock */ crd->is_uref = 1; + + /* check for signal */ + if (crd->do_unlock > 1) { + crd->do_unlock = 0; + goto error; + } } /* check if we are doing an open */ |