On Fri, 7 Feb 2014 09:15:40 +0000
Mark Einon <mark.ei...@gmail.com> wrote:

> On Wed, Feb 05, 2014 at 09:56:41PM +0800, Zhao, Gang wrote:
> > > @@ -2124,7 +2124,11 @@ static int et131x_rx_dma_memory_alloc(struct 
> > > et131x_adapter *adapter)
> > >  
> > >   /* Alloc memory for the lookup table */
> > >   rx_ring->fbr[0] = kmalloc(sizeof(struct fbr_lookup), GFP_KERNEL);
> > > + if (rx_ring->fbr[0] == NULL)
> > > +         return -ENOMEM;
> > >   rx_ring->fbr[1] = kmalloc(sizeof(struct fbr_lookup), GFP_KERNEL);
> > > + if (rx_ring->fbr[1])
> > 
> > Hi, I think it should be:
> > 
> > if (!rx_ring->fbr[1]) {
> >         kfree(rx_ring->fbr[0]);
> >         return -ENOMEM;
> > }
> > 
> > The other changes seem good.
> 
> Yes, I agree - if this function is going to clear up after itself, there
> are a few other allocations further down that also need to handle freeing
> already allocated resources, probably using the usual goto style.
> 
> Alan, would you like to send an updated patch?

I'll go back over it again and fix/double check those
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to