Alan Stern wrote:
Of course, there's another problem that's equally bad but less solvable.
If the SET_CONFIGURATION message fails, the device is left in an unknown
state, probably the same state as it was in before. But we have already
disabled all the interfaces and unbound all the drivers.
On Sat, 17 Apr 2004, Oliver Neukum wrote:
> > Presumably all the memory allocation should be done before clearing out
> > the prior state, so that if we run out of memory nothing will have
> > changed. How does that sound?
>
> Very sensible.
> But, as you noted, it won't solve the problem of the
> Of course, there's another problem that's equally bad but less solvable.
> If the SET_CONFIGURATION message fails, the device is left in an unknown
> state, probably the same state as it was in before. But we have already
> disabled all the interfaces and unbound all the drivers.
>
> Presumably
On Fri, 16 Apr 2004, Oliver Neukum wrote:
> Am Freitag, 16. April 2004 17:32 schrieb Alan Stern:
> > + cp->interface[i] = intf = kmalloc(sizeof(*intf),
> > GFP_KERNEL); + if (!intf) {
> > + dev_err(&dev->dev, "Out of memory");
> > +
Am Freitag, 16. April 2004 17:32 schrieb Alan Stern:
> + cp->interface[i] = intf = kmalloc(sizeof(*intf),
> GFP_KERNEL); + if (!intf) {
> + dev_err(&dev->dev, "Out of memory");
> + while (--i >= 0) {
> +
Greg:
This is a revised version of an earlier patch; I feel a lot better about
this one. Basically it does the same thing as before: allocate interfaces
dynamically to avoid the problems with reusing them.
The difference is that this patch adds a struct kref to the array of
usb_interface_cache'