Re: [linux-usb-devel] PATCH: (as246b) Allocate interface structures dynamically

2004-04-19 Thread David Brownell
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.

Re: [linux-usb-devel] PATCH: (as246b) Allocate interface structures dynamically

2004-04-16 Thread Alan Stern
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

Re: [linux-usb-devel] PATCH: (as246b) Allocate interface structures dynamically

2004-04-16 Thread Oliver Neukum
> 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

Re: [linux-usb-devel] PATCH: (as246b) Allocate interface structures dynamically

2004-04-16 Thread Alan Stern
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"); > > +

Re: [linux-usb-devel] PATCH: (as246b) Allocate interface structures dynamically

2004-04-16 Thread Oliver Neukum
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) { > +

[linux-usb-devel] PATCH: (as246b) Allocate interface structures dynamically

2004-04-16 Thread Alan Stern
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'