Re: [PATCH] hci-usb bugfix

From: Alan Stern
Date: Mon May 10 2004 - 11:16:38 EST


On Sun, 9 May 2004, Marcel Holtmann wrote:

> 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.

> 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

It looks like the problem is that hci_usb_disconnect() is trying to do too
much. When called for the SCO interface it should simply return.

Does this patch improve the situation?

Alan Stern



===== drivers/bluetooth/hci_usb.c 1.44 vs edited =====
--- 1.44/drivers/bluetooth/hci_usb.c Thu Apr 29 13:33:56 2004
+++ edited/drivers/bluetooth/hci_usb.c Mon May 10 12:10:31 2004
@@ -918,7 +918,7 @@
BT_ERR("Can't set isoc interface settings");
isoc_iface = NULL;
}
- usb_driver_claim_interface(&hci_usb_driver, isoc_iface, husb);
+ usb_driver_claim_interface(&hci_usb_driver, isoc_iface, NULL);
husb->isoc_iface = isoc_iface;
husb->isoc_in_ep = isoc_in_ep[isoc_ifnum];
husb->isoc_out_ep = isoc_out_ep[isoc_ifnum];

-
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/