Commit 8324af6d authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Jonathan Corbet

bluetooth-vhci: BKL pushdown

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 986837ba
......@@ -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>
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment