> -----Original Message-----
> From: Shilimkar, Santosh
> Sent: Saturday, July 24, 2010 2:13 AM
> > +   kfree(tcm);
> > +   kfree(pvt);
> If only one of the allocation was successful, then you
> are freeing a NULL pointer.
> May be have something like this
> 
>       tcm = kzalloc(sizeof(*tcm), GFP_KERNEL);
>       if (!tcm)
>               goto error1;
>       pvt = kzalloc(sizeof(*pvt), GFP_KERNEL);
>       if (!pvt)
>               goto error2;
>       .
>       .
>       .
> error1:
>       kfree(tcm);
> error2:
>       kfree(pvt);

Freeing a NULL pointer is always valid, and simply returns.  This is a C 
specification.

--
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