]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Bluetooth: vhci: Fix race at creating hci device
authorTakashi Iwai <tiwai@suse.de>
Thu, 14 Apr 2016 15:32:19 +0000 (17:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Jun 2016 19:18:00 +0000 (12:18 -0700)
commit0c27a6a6a5dd9621e2a1439e55cf371692556305
tree34342ec01b172165dec3ecc8f613b563c4260317
parentf8636442df7d1e9b3874c83668b57aeefbef97cb
Bluetooth: vhci: Fix race at creating hci device

commit c7c999cb18da88a881e10e07f0724ad0bfaff770 upstream.

hci_vhci driver creates a hci device object dynamically upon each
HCI_VENDOR_PKT write.  Although it checks the already created object
and returns an error, it's still racy and may build multiple hci_dev
objects concurrently when parallel writes are performed, as the device
tracks only a single hci_dev object.

This patch introduces a mutex to protect against the concurrent device
creations.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/bluetooth/hci_vhci.c