summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-03-20 20:12:44 +0100
committerMarcel Holtmann <marcel@holtmann.org>2005-03-20 20:12:44 +0100
commite48ca3fe83e0caaa4800bbb246e55ec5749b9d5a (patch)
treec9e0e9dd27dfb334b3c824c94ff2c2e6b95ba927 /drivers
parentf74cc48ecb9e1fd3ab3d50215d6073065820f19a (diff)
[Bluetooth] Fix race condition in virtual HCI driver
This patch fixes a race condition in the hci_vhci_chr_close() routine of the virtual HCI driver. Signed-off-by: Imre Deak <imre.deak@nokia.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/bluetooth/hci_vhci.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
index 49a80c925123..3256192dcde8 100644
--- a/drivers/bluetooth/hci_vhci.c
+++ b/drivers/bluetooth/hci_vhci.c
@@ -308,12 +308,13 @@ static int hci_vhci_chr_open(struct inode *inode, struct file * file)
static int hci_vhci_chr_close(struct inode *inode, struct file *file)
{
struct hci_vhci_struct *hci_vhci = (struct hci_vhci_struct *) file->private_data;
+ struct hci_dev *hdev = hci_vhci->hdev;
- if (hci_unregister_dev(hci_vhci->hdev) < 0) {
- BT_ERR("Can't unregister HCI device %s", hci_vhci->hdev->name);
+ if (hci_unregister_dev(hdev) < 0) {
+ BT_ERR("Can't unregister HCI device %s", hdev->name);
}
- hci_free_dev(hci_vhci->hdev);
+ hci_free_dev(hdev);
file->private_data = NULL;
return 0;