From 8324af6dddac11f9f7e9df8b784f6949ddb61b5d Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Tue, 20 May 2008 19:15:40 +0200 Subject: bluetooth-vhci: BKL pushdown Signed-off-by: Arnd Bergmann --- drivers/bluetooth/hci_vhci.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/bluetooth') diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c index 0638730a4a1..7734bc9af3c 100644 --- a/drivers/bluetooth/hci_vhci.c +++ b/drivers/bluetooth/hci_vhci.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -263,9 +264,11 @@ static int vhci_open(struct inode *inode, struct file *file) skb_queue_head_init(&data->readq); init_waitqueue_head(&data->read_wait); + lock_kernel(); hdev = hci_alloc_dev(); if (!hdev) { kfree(data); + unlock_kernel(); return -ENOMEM; } @@ -286,10 +289,12 @@ static int vhci_open(struct inode *inode, struct file *file) BT_ERR("Can't register HCI device"); kfree(data); hci_free_dev(hdev); + unlock_kernel(); return -EBUSY; } file->private_data = data; + unlock_kernel(); return nonseekable_open(inode, file); } -- cgit v1.2.3 From dbfb2df7e9fbd6e5ab8cd9b94b27767fe311fa0d Mon Sep 17 00:00:00 2001 From: Jonathan Corbet Date: Thu, 19 Jun 2008 16:07:51 -0600 Subject: Bluetooth VHCI: fasync BKL pushdown Signed-off-by: Jonathan Corbet --- drivers/bluetooth/hci_vhci.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'drivers/bluetooth') diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c index 7734bc9af3c..d97700aa54a 100644 --- a/drivers/bluetooth/hci_vhci.c +++ b/drivers/bluetooth/hci_vhci.c @@ -318,18 +318,21 @@ static int vhci_release(struct inode *inode, struct file *file) static int vhci_fasync(int fd, struct file *file, int on) { struct vhci_data *data = file->private_data; - int err; + int err = 0; + lock_kernel(); err = fasync_helper(fd, file, on, &data->fasync); if (err < 0) - return err; + goto out; if (on) data->flags |= VHCI_FASYNC; else data->flags &= ~VHCI_FASYNC; - return 0; +out: + unlock_kernel(); + return err; } static const struct file_operations vhci_fops = { -- cgit v1.2.3 From 8187b4fb9c17ea8e2a71c0563434f3ee08aad0d7 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Fri, 23 May 2008 23:56:51 +0100 Subject: bluetooth: treat firmware data as const Signed-off-by: David Woodhouse --- drivers/bluetooth/bfusb.c | 3 ++- drivers/bluetooth/bt3c_cs.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/bluetooth') diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c index b990805806a..0c211adbc06 100644 --- a/drivers/bluetooth/bfusb.c +++ b/drivers/bluetooth/bfusb.c @@ -566,7 +566,8 @@ static int bfusb_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long arg return -ENOIOCTLCMD; } -static int bfusb_load_firmware(struct bfusb_data *data, unsigned char *firmware, int count) +static int bfusb_load_firmware(struct bfusb_data *data, + const unsigned char *firmware, int count) { unsigned char *buf; int err, pipe, len, size, sent = 0; diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c index 7703d6e06fd..593b7c59503 100644 --- a/drivers/bluetooth/bt3c_cs.c +++ b/drivers/bluetooth/bt3c_cs.c @@ -470,7 +470,8 @@ static int bt3c_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long /* ======================== Card services HCI interaction ======================== */ -static int bt3c_load_firmware(bt3c_info_t *info, unsigned char *firmware, int count) +static int bt3c_load_firmware(bt3c_info_t *info, const unsigned char *firmware, + int count) { char *ptr = (char *) firmware; char b[9]; -- cgit v1.2.3