diff options
-rw-r--r-- | drivers/bluetooth/btusb.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index b4756a6a3a68..29ae99817c60 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
@@ -172,6 +172,7 @@ static struct usb_device_id blacklist_table[] = { | |||
172 | struct btusb_data { | 172 | struct btusb_data { |
173 | struct hci_dev *hdev; | 173 | struct hci_dev *hdev; |
174 | struct usb_device *udev; | 174 | struct usb_device *udev; |
175 | struct usb_interface *intf; | ||
175 | struct usb_interface *isoc; | 176 | struct usb_interface *isoc; |
176 | 177 | ||
177 | spinlock_t lock; | 178 | spinlock_t lock; |
@@ -826,6 +827,7 @@ static int btusb_probe(struct usb_interface *intf, | |||
826 | } | 827 | } |
827 | 828 | ||
828 | data->udev = interface_to_usbdev(intf); | 829 | data->udev = interface_to_usbdev(intf); |
830 | data->intf = intf; | ||
829 | 831 | ||
830 | spin_lock_init(&data->lock); | 832 | spin_lock_init(&data->lock); |
831 | 833 | ||
@@ -894,7 +896,7 @@ static int btusb_probe(struct usb_interface *intf, | |||
894 | 896 | ||
895 | if (data->isoc) { | 897 | if (data->isoc) { |
896 | err = usb_driver_claim_interface(&btusb_driver, | 898 | err = usb_driver_claim_interface(&btusb_driver, |
897 | data->isoc, NULL); | 899 | data->isoc, data); |
898 | if (err < 0) { | 900 | if (err < 0) { |
899 | hci_free_dev(hdev); | 901 | hci_free_dev(hdev); |
900 | kfree(data); | 902 | kfree(data); |
@@ -926,13 +928,22 @@ static void btusb_disconnect(struct usb_interface *intf) | |||
926 | 928 | ||
927 | hdev = data->hdev; | 929 | hdev = data->hdev; |
928 | 930 | ||
929 | if (data->isoc) | 931 | __hci_dev_hold(hdev); |
930 | usb_driver_release_interface(&btusb_driver, data->isoc); | ||
931 | 932 | ||
932 | usb_set_intfdata(intf, NULL); | 933 | usb_set_intfdata(data->intf, NULL); |
934 | |||
935 | if (data->isoc) | ||
936 | usb_set_intfdata(data->isoc, NULL); | ||
933 | 937 | ||
934 | hci_unregister_dev(hdev); | 938 | hci_unregister_dev(hdev); |
935 | 939 | ||
940 | if (intf == data->isoc) | ||
941 | usb_driver_release_interface(&btusb_driver, data->intf); | ||
942 | else if (data->isoc) | ||
943 | usb_driver_release_interface(&btusb_driver, data->isoc); | ||
944 | |||
945 | __hci_dev_put(hdev); | ||
946 | |||
936 | hci_free_dev(hdev); | 947 | hci_free_dev(hdev); |
937 | } | 948 | } |
938 | 949 | ||