Hi,
> > > Am Freitag, 26. Februar 2010 11:39:06 schrieb Ajay Kumar Gupta:
> > > > +struct queue *create(void)
> > > > +{
> > > > + struct queue *new;
> > > > + new = kmalloc(sizeof(struct queue), GFP_ATOMIC);
> > > > + if (!new)
> > > > + return NULL;
> > > > + new->next = NULL;
> > > > + return new;
> > > > +}
> > > > +void push_queue(struct musb *musb, struct urb *urb)
> > > > +{
> > > > + struct queue *new, *temp;
> > > > +
> > > > + new = create();
> > > > + new->urb = urb;
> > >
> > > And you happily follow the NULL pointer in the error case.
> >
> > I will put the NULL check here and also during push_queue(). In case
> > Of memory allocation failure I can giveback the URB right away.
>
> If you do that you'll give back URBs out of order.
Right, this would confuse the class driver and better avoided.
Next option is to add another list_head within URB structure to trace
the URBs. (as you suggested earlier)
-Ajay
> Now I don't know whether this is defined as something you mustn't
> do, bad it is not a good idea.
>
> Regards
> Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html