Am Freitag, 26. Februar 2010 12:20:05 schrieb Gupta, Ajay Kumar:

Hello,

> > -----Original Message-----
> > From: Oliver Neukum [mailto:[email protected]]
> > Sent: Friday, February 26, 2010 4:33 PM
> > To: Gupta, Ajay Kumar
> > Cc: [email protected]; [email protected];
> > [email protected]
> > Subject: Re: [PATCH] musb: Add workqueue for URB giveback
> > 
> > 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. 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

Reply via email to