Re: [PATCH] hci-usb bugfix

From: Alan Stern
Date: Tue May 11 2004 - 10:01:42 EST


Oliver was right about not using interfaces after they have been released.
I think the best approach will be for the hci_usb_disconnect() routine to
release both interfaces when it is called. Something like this:

In hci_usb.h, add to struct hci_usb:
struct usb_interface *acl_iface;

In hci_usb_probe, add near the end:
husb->acl_iface = intf;

In hci_usb_disconnect, add:

/* Always release both interfaces whenever we must release either */
if (intf == husb->isoc_iface)
usb_driver_release_interface(&hci_usb_driver,
husb->acl_iface);
else if (husb->isoc_iface)
usb_driver_release_interface(&hci_usb_driver,
husb->isoc_iface);

It's not necessary to set the interface private pointers back to NULL,
since the USB core will do that for you when the interface is released.

Alan Stern


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