Commit f5174ca0 authored by Marcel Holtmann's avatar Marcel Holtmann

[Bluetooth] Fix disconnect race on ISOC interface

The hci_usb_disconnect() gets called recursively when SCO support
is enabled and used. This causes sysfs_hash_and_remove() finally to
dereference a NULL pointer.

Noticed by Sebastian Schmidt <yath@yath.eu.org>
parent 3dc567d8
......@@ -976,11 +976,13 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
static void hci_usb_disconnect(struct usb_interface *intf)
{
struct hci_usb *husb = usb_get_intfdata(intf);
struct hci_dev *hdev = husb->hdev;
struct hci_dev *hdev;
if (!husb)
if (!husb || intf == husb->isoc_iface)
return;
usb_set_intfdata(intf, NULL);
hdev = husb->hdev;
BT_DBG("%s", hdev->name);
......
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