]> git.baikalelectronics.ru Git - kernel.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)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 20 Apr 2016 14:28:28 +0000 (16:28 +0200)
commit09ae1d32fb95e075048c5a353db045021a565e37
treef211ce1476402b62d2395b04684ec86391fd0722
parent423a155e97a819ec49708a586b08dcff514ba8df
Bluetooth: vhci: Fix race at creating hci device

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.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/hci_vhci.c