Skip to content

Commit

Permalink
bluetooth-vhci: BKL pushdown
Browse files Browse the repository at this point in the history
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
  • Loading branch information
Arnd Bergmann authored and Jonathan Corbet committed Jun 20, 2008
1 parent 986837b commit 8324af6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/bluetooth/hci_vhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/sched.h>
Expand Down Expand Up @@ -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;
}

Expand All @@ -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);
}
Expand Down

0 comments on commit 8324af6

Please sign in to comment.