Re: [PATCH] hci-usb bugfix

From: Marcel Holtmann
Date: Sun May 09 2004 - 15:45:03 EST


Hi Sebastian,

> this is a little patch against 2.6.6-rc3 which fixes the Oops when
> unplugging an USB Bluetooth device.
>
> hci_usb_disconnect() got called recursively which caused
> sysfs_hash_and_remove() finally to dereference a NULL pointer.
>
> --- SNIP ---
> diff -uNr linux-2.6.6-rc3.old/drivers/bluetooth/hci_usb.c linux-2.6.6-rc3/drivers/bluetooth/hci_usb.c
> --- linux-2.6.6-rc3.old/drivers/bluetooth/hci_usb.c 2004-05-09 20:25:00.000000000 +0200
> +++ linux-2.6.6-rc3/drivers/bluetooth/hci_usb.c 2004-05-09 20:28:30.000000000 +0200
> @@ -986,8 +986,21 @@
>
> hci_usb_close(hdev);
>
> - if (husb->isoc_iface)
> + if (husb->isoc_iface) {
> +#if 0
> usb_driver_release_interface(&hci_usb_driver, husb->isoc_iface);
> +#else
> + /* do the same as usb_driver_release_interface would do,
> + * except calling diconnect().
> + * usb_driver_release_interface() _does_ check if
> + * are in disconnect() or add, but I really dunno
> + * where dev->driver_list or dev->bus_list gets set.
> + * -- yath
> + */
> + husb->isoc_iface->dev.driver = NULL;
> + usb_set_intfdata(husb->isoc_iface, NULL);
> +#endif
> + }
>
> if (hci_unregister_dev(hdev) < 0)
> BT_ERR("Can't unregister HCI device %s", hdev->name);
> --- SNAP ---
>
> Please apply it,

thanks for finding the reason for this problem, because the only thing
that I knew, was that enabled SCO support caused this problem. I prefer
to let the USB guys fix it, because this bug should be present for all
drivers that claimed more than one interface.

Regards

Marcel


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/