svn commit: r351324 - head/sys/netgraph/bluetooth/drivers/ubt
Conrad Meyer
cem at freebsd.org
Wed Aug 21 07:59:08 UTC 2019
Hi Xin Li,
On Wed, Aug 21, 2019 at 12:45 AM Xin LI <delphij at freebsd.org> wrote:
> URL: https://svnweb.freebsd.org/changeset/base/351324
>
> Log:
> 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.
>
> --- head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Wed Aug 21 04:54:48 2019 (r351323)
> +++ head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Wed Aug 21 07:45:39 2019 (r351324)
> @@ -554,6 +554,7 @@ ubt_do_hci_request(struct usb_device *udev, struct ubt
> /* Initialize INTR endpoint xfer and wait for response */
> + bzero(&mtx, sizeof(mtx));
> mtx_init(&mtx, "ubt pb", NULL, MTX_DEF);
This is usually spelled 'MTX_DEF | MTX_NEW' instead.
Best regards,
Conrad
More information about the svn-src-all
mailing list