{
struct hci_vhci_struct *hci_vhci = (struct hci_vhci_struct *) file->private_data;
- if (verify_area(VERIFY_READ, buf, count))
+ if (!access_ok(VERIFY_READ, buf, count))
return -EFAULT;
return hci_vhci_get_user(hci_vhci, buf, count);
continue;
}
- if (!verify_area(VERIFY_WRITE, buf, count))
+ if (access_ok(VERIFY_WRITE, buf, count))
ret = hci_vhci_put_user(hci_vhci, skb, buf, count);
else
ret = -EFAULT;
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;