diff options
| author | Marcel Holtmann <marcel@holtmann.org> | 2004-10-28 03:48:28 +0200 |
|---|---|---|
| committer | Marcel Holtmann <linux-mh.adm@bkbits.net> | 2004-10-28 03:48:28 +0200 |
| commit | e05082148e011a6aba06edd617dff5c95151e027 (patch) | |
| tree | 14c90981d29835a549e6edfaf5f4707f00fd4f0e | |
| parent | c72eed4ffdecbca7a57b20ad9184da3bf9fbc845 (diff) | |
[Bluetooth] Fix another disconnect race
When the selecting of the alternate setting for the SCO audio support
fails, the hci_usb_disconnect() will dereference a NULL pointer. To
avoid this, the isoc_iface variable must be set before releasing the
interface and unset afterwards.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| -rw-r--r-- | drivers/bluetooth/hci_usb.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c index 16775f3048ea..d0c197db3ce4 100644 --- a/drivers/bluetooth/hci_usb.c +++ b/drivers/bluetooth/hci_usb.c @@ -796,6 +796,11 @@ static void hci_usb_destruct(struct hci_dev *hdev) kfree(husb); } +static void hci_usb_notify(struct hci_dev *hdev, unsigned int evt) +{ + BT_DBG("%s evt %d", hdev->name, evt); +} + int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) { struct usb_device *udev = interface_to_usbdev(intf); @@ -912,7 +917,9 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) BT_ERR("Can't claim isoc interface"); else if (usb_set_interface(udev, isoc_ifnum, isoc_alts)) { BT_ERR("Can't set isoc interface settings"); + husb->isoc_iface = isoc_iface; usb_driver_release_interface(&hci_usb_driver, isoc_iface); + husb->isoc_iface = NULL; } else { husb->isoc_iface = isoc_iface; husb->isoc_in_ep = isoc_in_ep; @@ -948,6 +955,7 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) hdev->flush = hci_usb_flush; hdev->send = hci_usb_send_frame; hdev->destruct = hci_usb_destruct; + hdev->notify = hci_usb_notify; hdev->owner = THIS_MODULE; |
