Fix a panic in ubt_do_hci_request.

The 'mtx' is on stack and can contain garbages that would cause mtx_init
(and in turn lock_init) to think that the mutex was already initialized.
This commit is contained in:
Xin LI 2019-08-21 07:45:39 +00:00
parent d7cf1814bd
commit ee318606ce
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=351324

View file

@ -554,6 +554,7 @@ ubt_do_hci_request(struct usb_device *udev, struct ubt_hci_cmd *cmd,
return (USB_ERR_NORMAL_COMPLETION);
/* Initialize INTR endpoint xfer and wait for response */
bzero(&mtx, sizeof(mtx));
mtx_init(&mtx, "ubt pb", NULL, MTX_DEF);
error = usbd_transfer_setup(udev, &iface_index, xfer,