On Wed, Mar 07, 2001 at 11:52:38PM -0800, Greg KH wrote:
> On Wed, Mar 07, 2001 at 06:35:31PM -0800, Jean Tourrilhes wrote:
> > Johannes Erdfelt wrote :
> > > The key is probably the function that calls irda_usb_change_speed_xbofs.
> > > Most likely it allocates self on the stack (as an automatic variable)
> > > which is not a valid memory location to DMA from and to.
> > 
> >     No, self is not on the stack, I can guarantee you that. It's
> > declared as :
> > ---------------------------
> > static struct irda_usb_cb irda_instance[NIRUSB];
> 
> Try making that a dynamically allocated array of pointers and see if
> that solves your problem.
> 
> Something like:
>       static struct irda_usb_cb *irda_instance[NIRUSB];
> and then create the struct irda_usb_cb at probe time.
> 
> greg k-h

        I try to avoid as much as possible dynamically allocated
stuff, because it's overhead and a pain to track and deallocate at the
right time. I'll keep solution one (only dynamically allocate the
constant buffer).
        So, in conclusion, not only buffers on the stack is no-no, but
static buffers are also no-no. I hope it'll go in the FAQ.
        Thanks...

        Jean

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
http://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to